linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@dilger.ca>
To: Fengnan Chang <changfengnan@vivo.com>
Cc: "Theodore Y. Ts'o" <tytso@mit.edu>,
	Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH v2] ext4: fix error code in ext4_commit_super
Date: Sat, 3 Apr 2021 12:34:50 -0600	[thread overview]
Message-ID: <F552F506-E58D-4705-A2B5-FA2DD8BA2F92@dilger.ca> (raw)
In-Reply-To: <20210402101631.561-1-changfengnan@vivo.com>

[-- Attachment #1: Type: text/plain, Size: 1073 bytes --]

On Apr 2, 2021, at 4:16 AM, Fengnan Chang <changfengnan@vivo.com> wrote:
> 
> We should set the error code when ext4_commit_super check argument failed.
> Found in code review.
> Fixes: c4be0c1dc4cdc ("filesystem freeze: add error handling of write_super_lockfs/unlockfs").
> 
> Signed-off-by: Fengnan Chang <changfengnan@vivo.com>

Reviewed-by: Andreas Dilger <adilger@dilger.ca>

> ---
> fs/ext4/super.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 03373471131c..1130599c87dc 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -5500,8 +5500,10 @@ static int ext4_commit_super(struct super_block *sb, int sync)
> 	struct buffer_head *sbh = EXT4_SB(sb)->s_sbh;
> 	int error = 0;
> 
> -	if (!sbh || block_device_ejected(sb))
> -		return error;
> +	if (!sbh)
> +		return -EINVAL;
> +	if (block_device_ejected(sb))
> +		return -ENODEV;
> 
> 	/*
> 	 * If the file system is mounted read-only, don't update the
> --
> 2.29.0
> 


Cheers, Andreas






[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 873 bytes --]

  reply	other threads:[~2021-04-03 18:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-02 10:16 [PATCH v2] ext4: fix error code in ext4_commit_super Fengnan Chang
2021-04-03 18:34 ` Andreas Dilger [this message]
2021-04-09 22:45   ` Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F552F506-E58D-4705-A2B5-FA2DD8BA2F92@dilger.ca \
    --to=adilger@dilger.ca \
    --cc=changfengnan@vivo.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).