aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosef Bacik <josef@redhat.com>2011-03-16 13:59:32 -0400
committerJosef Bacik <josef@redhat.com>2011-03-17 14:21:39 -0400
commit41415730a1050499fbd63b3f7dd59b3a4c3bb91a (patch)
treef379a75ded5241e303fd78bcfe5d6ca257058dc1
parenta826d6dcb32d811b4c81df57a5ef1367516586b0 (diff)
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>
-rw-r--r--fs/btrfs/file.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 3786eca2a905..a85b044cf39e 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -608,6 +608,8 @@ again:
608 key.offset = split; 608 key.offset = split;
609 609
610 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); 610 ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
611 if (ret < 0)
612 goto out;
611 if (ret > 0 && path->slots[0] > 0) 613 if (ret > 0 && path->slots[0] > 0)
612 path->slots[0]--; 614 path->slots[0]--;
613 615