btrfs: return ENOMEM if path allocation fails in btrfs_cross_ref_exist
authorSu Yue <suy.fnst@cn.fujitsu.com>
Wed, 30 May 2018 06:49:10 +0000 (14:49 +0800)
committerDavid Sterba <dsterba@suse.com>
Wed, 30 May 2018 15:33:58 +0000 (17:33 +0200)
The error code does not match the reason of failure and may confuse the
callers.

Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c

index 9a65df02a13f65ca421d6119b52afc6f3570000b..3d9fe58c0080db89f4933f162f8bf7f8d6df1c85 100644 (file)
@@ -3272,7 +3272,7 @@ int btrfs_cross_ref_exist(struct btrfs_root *root, u64 objectid, u64 offset,
 
        path = btrfs_alloc_path();
        if (!path)
-               return -ENOENT;
+               return -ENOMEM;
 
        do {
                ret = check_committed_ref(root, path, objectid,