Skip to content

Commit

Permalink
Btrfs: check return value of btrfs_search_slot properly
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Josef Bacik committed Mar 17, 2011
1 parent a826d6d commit 4141573
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/btrfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]--;

Expand Down

0 comments on commit 4141573

Please sign in to comment.