diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c index d0bc72657cd716ee4f4b3f1afea562d33b965c78..4f19a3e1bf328dc39ab763dc6f604095aa5d76c7 100644 --- a/fs/btrfs/file-item.c +++ b/fs/btrfs/file-item.c @@ -550,7 +550,10 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans, if (path->slots[0] == 0) goto out; path->slots[0]--; + } else if (ret < 0) { + goto out; } + leaf = path->nodes[0]; btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);