diff options
author | Chris Mason <chris.mason@oracle.com> | 2010-03-15 10:21:30 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2010-03-15 11:00:15 -0400 |
commit | 5ff7ba3a797a8ffd5299b8477df2dca3c3ebd34e (patch) | |
tree | 598f33540071cd31bd7738b5d6246bfbaa0d9b3b /fs/btrfs | |
parent | a343832f1a55c74791a8a37053fc02ad80640710 (diff) | |
download | linux-5ff7ba3a797a8ffd5299b8477df2dca3c3ebd34e.tar.bz2 |
Btrfs: don't look at bio flags after submit_bio
After callling submit_bio, the bio can be freed at any time. The
btrfs submission thread helper was checking the bio flags too late,
which might not give the correct answer.
When CONFIG_DEBUG_PAGE_ALLOC is turned on, it can lead to oopsen.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/volumes.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 4053fc44d2cf..9df8e3f1ccab 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -256,13 +256,13 @@ loop_lock: wake_up(&fs_info->async_submit_wait); BUG_ON(atomic_read(&cur->bi_cnt) == 0); - submit_bio(cur->bi_rw, cur); - num_run++; - batch_run++; if (bio_rw_flagged(cur, BIO_RW_SYNCIO)) num_sync_run++; + submit_bio(cur->bi_rw, cur); + num_run++; + batch_run++; if (need_resched()) { if (num_sync_run) { blk_run_backing_dev(bdi, NULL); |