Commit 07cc6ef
bcache: fix race of writeback thread starting before complete initialization
The bch_writeback_thread might BUG_ON in read_dirty() if
dc->sb==BDEV_STATE_DIRTY and bch_sectors_dirty_init has not yet completed
its related initialization. This patch downs the dc->writeback_lock until
after initialization is complete, thus preventing bch_writeback_thread
from proceeding prematurely.
See this thread:
http://thread.gmane.org/gmane.linux.kernel.bcache.devel/3453
Signed-off-by: Eric Wheeler <bcache@linux.ewheeler.net>
Tested-by: Marc MERLIN <marc@merlins.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Jens Axboe <axboe@fb.com>1 parent 08095e7 commit 07cc6ef
1 file changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1015 | 1015 | | |
1016 | 1016 | | |
1017 | 1017 | | |
1018 | | - | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
1019 | 1022 | | |
| 1023 | + | |
1020 | 1024 | | |
1021 | 1025 | | |
1022 | 1026 | | |
| |||
1028 | 1032 | | |
1029 | 1033 | | |
1030 | 1034 | | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
1031 | 1038 | | |
1032 | 1039 | | |
1033 | 1040 | | |
| |||
0 commit comments