btrfs: return original error code when failing from option parsing
authorChengguang Xu <cgxu519@gmx.com>
Wed, 9 May 2018 13:08:23 +0000 (21:08 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 28 May 2018 16:07:30 +0000 (18:07 +0200)
It's not good to overwrite -ENOMEM using -EINVAL when failing from mount
option parsing, so just return original error code.

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/super.c

index 0628092..c67fafa 100644 (file)
@@ -1782,10 +1782,8 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)
        }
 
        ret = btrfs_parse_options(fs_info, data, *flags);
-       if (ret) {
-               ret = -EINVAL;
+       if (ret)
                goto restore;
-       }
 
        btrfs_remount_begin(fs_info, old_opts, *flags);
        btrfs_resize_thread_pool(fs_info,