diff options
author | Zhao Lei <zhaolei@cn.fujitsu.com> | 2015-12-31 21:07:17 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-02-18 10:26:12 +0100 |
commit | b257cf50060cada63a3fe11a932909b9badf4595 (patch) | |
tree | 3b4d36cafc38ee4fb67baf0b134b09f229b54d36 /fs/btrfs/reada.c | |
parent | 1e7970c0f31d6916e0ab523e5f05c9741f71955f (diff) | |
download | linux-stable-b257cf50060cada63a3fe11a932909b9badf4595.tar.gz linux-stable-b257cf50060cada63a3fe11a932909b9badf4595.tar.bz2 linux-stable-b257cf50060cada63a3fe11a932909b9badf4595.zip |
btrfs: reada: move reada_extent_put to place after __readahead_hook()
We can't release reada_extent earlier than __readahead_hook(), because
__readahead_hook() still need to use it, it is necessary to hode a refcnt
to avoid it be freed.
Actually it is not a problem after my patch named:
Avoid many times of empty loop
It make reada_extent in above line include at least one reada_extctl,
which keeps additional one refcnt for reada_extent.
But we still need this patch to make the code in pretty logic.
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/reada.c')
-rw-r--r-- | fs/btrfs/reada.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/reada.c b/fs/btrfs/reada.c index b40dbf717737..f7642e569bd9 100644 --- a/fs/btrfs/reada.c +++ b/fs/btrfs/reada.c @@ -717,8 +717,6 @@ static int reada_start_machine_dev(struct btrfs_fs_info *fs_info, } logical = re->logical; - reada_extent_put(fs_info, re); - atomic_inc(&dev->reada_in_flight); ret = reada_tree_block_flagged(fs_info->extent_root, logical, mirror_num, &eb); @@ -730,6 +728,8 @@ static int reada_start_machine_dev(struct btrfs_fs_info *fs_info, if (eb) free_extent_buffer(eb); + reada_extent_put(fs_info, re); + return 1; } |