mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
Btrfs: check return value of btrfs_search_slot properly
Doing an audit of where we use btrfs_search_slot only showed one place where we don't check the return value of btrfs_search_slot properly. Just fix mark_extent_written to see if btrfs_search_slot failed and act accordingly. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com>
This commit is contained in:
parent
a826d6dcb3
commit
41415730a1
1 changed files with 2 additions and 0 deletions
|
@ -608,6 +608,8 @@ int btrfs_mark_extent_written(struct btrfs_trans_handle *trans,
|
|||
key.offset = split;
|
||||
|
||||
ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
if (ret > 0 && path->slots[0] > 0)
|
||||
path->slots[0]--;
|
||||
|
||||
|
|
Loading…
Reference in a new issue