linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: Wang Jianjian <wangjianjian0@foxmail.com>
Cc: jaegeuk@kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: Fix incorrect return value
Date: Sun, 7 Apr 2024 14:23:45 +0800	[thread overview]
Message-ID: <b68f94da-4477-4ab5-b979-aa260e0b8ef3@kernel.org> (raw)
In-Reply-To: <tencent_67A0192ABE8A513889F4DCEEFD83DC2FBB0A@qq.com>

On 2024/4/4 21:47, Wang Jianjian wrote:
> dquot_mark_dquot_dirty returns old dirty state not the error code.

I think it's fine to just pass return value of dquot_mark_dquot_dirty()
to caller, because caller can distinguish status from return value:
1) < 0, there is an error, 2) >= 0, there is no error, previously it is
dirty if it is 1.

Thanks,

> 
> Signed-off-by: Wang Jianjian <wangjianjian0@foxmail.com>
> ---
>   fs/f2fs/super.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> index a6867f26f141..af07027475d9 100644
> --- a/fs/f2fs/super.c
> +++ b/fs/f2fs/super.c
> @@ -3063,13 +3063,13 @@ static int f2fs_dquot_mark_dquot_dirty(struct dquot *dquot)
>   {
>   	struct super_block *sb = dquot->dq_sb;
>   	struct f2fs_sb_info *sbi = F2FS_SB(sb);
> -	int ret = dquot_mark_dquot_dirty(dquot);
>   
> +	dquot_mark_dquot_dirty(dquot);
>   	/* if we are using journalled quota */
>   	if (is_journalled_quota(sbi))
>   		set_sbi_flag(sbi, SBI_QUOTA_NEED_FLUSH);
>   
> -	return ret;
> +	return 0;
>   }
>   
>   static int f2fs_dquot_commit_info(struct super_block *sb, int type)


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

  reply	other threads:[~2024-04-07  6:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-04 13:47 [f2fs-dev] [PATCH] f2fs: Fix incorrect return value Wang Jianjian
2024-04-07  6:23 ` Chao Yu [this message]
2024-04-09  6:47   ` wangjianjian (C) via Linux-f2fs-devel
2024-04-11  9:28     ` Chao Yu

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=b68f94da-4477-4ab5-b979-aa260e0b8ef3@kernel.org \
    --to=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=wangjianjian0@foxmail.com \
    /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).