* [PATCH] Btrfs: check return value of btrfs_search_slot properly
@ 2011-03-16 18:01 Josef Bacik
0 siblings, 0 replies; only message in thread
From: Josef Bacik @ 2011-03-16 18:01 UTC (permalink / raw)
To: linux-btrfs
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>
---
fs/btrfs/file.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
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]--;
--
1.7.2.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-03-16 18:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-16 18:01 [PATCH] Btrfs: check return value of btrfs_search_slot properly Josef Bacik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).