]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fill_holes: Fix slot number passed to hole_mergeable() call.
authorchandan <chandan@linux.vnet.ibm.com>
Tue, 1 Jul 2014 06:34:28 +0000 (12:04 +0530)
committerChris Mason <clm@fb.com>
Tue, 19 Aug 2014 15:36:26 +0000 (08:36 -0700)
commit591f80140f54560cd52e07afc7edceb7968a5129
tree3ff2df1816f2f086130f803157a598e40c76ddb8
parent4d52d2aa6f4c9f7b9fdb8bdd80fb99b8547c8e27
Btrfs: fill_holes: Fix slot number passed to hole_mergeable() call.

For a non-existent key, btrfs_search_slot() sets path->slots[0] to the slot
where the key could have been present, which in this case would be the slot
containing the extent item which would be the next neighbor of the file range
being punched. The current code passes an incremented path->slots[0] and we
skip to the wrong file extent item. This would mean that we would fail to
merge the "yet to be created" hole with the next neighboring hole (if one
exists). Fix this.

Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/file.c