[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180228121536.3z7b76wuttsdmhjc@quack2.suse.cz>
Date: Wed, 28 Feb 2018 13:15:36 +0100
From: Jan Kara <jack@...e.cz>
To: Chengguang Xu <cgxu519@...oud.com>
Cc: jack@...e.cz, linux-ext4@...r.kernel.org
Subject: Re: [PATCH] ext2: change return code to -ENOMEM when failing memory
allocation
On Mon 26-02-18 17:45:12, Chengguang Xu wrote:
> Change return code to -ENOMEM from -EINVAL when failing memory allocation in fill_super(),
> meanwhile delete redundant initial assignment of variable err.
>
> Signed-off-by: Chengguang Xu <cgxu519@...oud.com>
Thanks, I have merged the patch. But please format git changelogs with
lines shorter than 75 characters next time. Thanks!
Honza
> ---
> fs/ext2/super.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ext2/super.c b/fs/ext2/super.c
> index 1dd62ed..15f26d2 100644
> --- a/fs/ext2/super.c
> +++ b/fs/ext2/super.c
> @@ -756,14 +756,13 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
> unsigned long logic_sb_block;
> unsigned long offset = 0;
> unsigned long def_mount_opts;
> - long ret = -EINVAL;
> + long ret = -ENOMEM;
> int blocksize = BLOCK_SIZE;
> int db_count;
> int i, j;
> __le32 features;
> int err;
>
> - err = -ENOMEM;
> sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
> if (!sbi)
> goto failed_unlock;
> @@ -778,6 +777,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
> sbi->s_sb_block = sb_block;
>
> spin_lock_init(&sbi->s_lock);
> + ret = -EINVAL;
>
> /*
> * See what the current blocksize for the device is, and
> --
> 1.8.3.1
>
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists