btrfs: set ret to 0 in btrfs_get_extent
PATCH 1/1 btrfs: set ret to 0 in btrfs_get_extent
When btrfs_get_extent is called for a range that has an overlapping inline extent coupled with with 'page' parameter being NULL it will erroneously return an error instead of the populate extent_mapping struct. Fix this by setting ret to 0 in case we don't have an exact match for our range.
--- fs/btrfs/inode.c | 1 + 1 file changed, 1 insertion(+)
fs/btrfs/inode.c +1 -0
@@ -6593,6 +6593,7 @@ struct extent_map *btrfs_get_extent(struct btrfs_inode *inode,if (path->slots[0 ] ==0 ) goto not_found; path->slots[0 ]--; + ret =0 ; } leaf = path->nodes[0 ];
Signature · 1 line
2.17.1
Quoted 9 lines · Nikolay Borisov
When
btrfs_get_extentis called for a range that has an overlapping inline extent coupled with with 'page' parameter being NULL it will erroneously return an error instead of the populateextent_mappingstruct. Fix this by setting ret to 0 in case we don't have an exact match for our range.Fixes 85b1eebdaf1d: "btrfs: remove err variable from btrfs_get_extent"Signed-off-by Nikolay Borisov <[email protected]>---
I believe this could simply be folded in the original patch, no ?
Quoted 16 lines
fs/btrfs/inode.c | 1 + 1 file changed, 1 insertion(+)fs/btrfs/inode.c +1
-0@@ -6593,6 +6593,7 @@ struct extent_map *btrfs_get_extent(struct btrfs_inode *inode,if (path->slots[0 ] ==0 ) goto not_found; path->slots[0 ]--; + ret =0 ; } leaf = path->nodes[0 ];
Quoted 9 lines · Nikolay Borisov
Quoted 6 lines · Nikolay Borisov
When
btrfs_get_extentis called for a range that has an overlapping inline extent coupled with with 'page' parameter being NULL it will erroneously return an error instead of the populateextent_mappingstruct. Fix this by setting ret to 0 in case we don't have an exact match for our range.
Quoted 5 lines
Quoted 3 lines
Fixes 85b1eebdaf1d: "btrfs: remove err variable from btrfs_get_extent"Signed-off-by Nikolay Borisov <[email protected]>---
I believe this could simply be folded in the original patch, no ?
Yes, that's what I'm going to do, thanks.