From 891f41cb27cf5036e88053bb0ef688f98fcc945b Mon Sep 17 00:00:00 2001 From: Chengguang Xu Date: Wed, 9 May 2018 21:08:23 +0800 Subject: [PATCH] btrfs: return original error code when failing from option parsing 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 Reviewed-by: David Sterba Reviewed-by: Qu Wenruo Signed-off-by: David Sterba --- fs/btrfs/super.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 0628092b0b1b..c67fafaa2fe7 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -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, -- GitLab