Skip to contentSkip to conversation

Btrfs: check return value of btrfs_search_slot properly

PATCH New Josef Bacik 1 participant 1 message Mar 16, 2011 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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,

---
 fs/btrfs/file.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
fs/btrfs/file.c +2 -0
index 3786eca..a85b044 100644
@@ -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]--;
 
Signature · 1 line
1.7.2.3