diff options
-rw-r--r-- | fs/btrfs/file-item.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c index 687529c61d13..c3f3c25dda38 100644 --- a/fs/btrfs/file-item.c +++ b/fs/btrfs/file-item.c @@ -889,10 +889,12 @@ again: nritems = btrfs_header_nritems(path->nodes[0]); if (!nritems || (path->slots[0] >= nritems - 1)) { ret = btrfs_next_leaf(root, path); - if (ret == 1) + if (ret < 0) { + goto out; + } else if (ret > 0) { found_next = 1; - if (ret != 0) goto insert; + } slot = path->slots[0]; } btrfs_item_key_to_cpu(path->nodes[0], &found_key, slot); |