From: Josef Bacik Date: Wed, 16 Mar 2011 17:59:32 +0000 (-0400) Subject: Btrfs: check return value of btrfs_search_slot properly X-Git-Tag: v3.0~816^2~69 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=41415730a1050499fbd63b3f7dd59b3a4c3bb91a;p=platform%2Fkernel%2Flinux-amlogic.git 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 --- diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 3786eca..a85b044 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -608,6 +608,8 @@ again: 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]--;