linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: Wang Shilong <wangshilong1991@gmail.com>, Yangtao Li <frank.li@vivo.com>
Cc: jaegeuk@kernel.org, linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: handle dqget error in f2fs_transfer_project_quota()
Date: Thu, 23 Mar 2023 22:41:52 +0800	[thread overview]
Message-ID: <0f1704e5-4a4f-d920-9c69-e01ed2f0dde5@kernel.org> (raw)
In-Reply-To: <20230221144550.46557-1-frank.li@vivo.com>

+Shilong,

Hi, Shilong,

Could you please help to check this patch? in original patch, it tries to
ignore such error intentionally? or it is a bug?

On 2023/2/21 22:45, Yangtao Li wrote:
> We should set the error code when dqget() failed.
> 
> Fixes: 2c1d03056991 ("f2fs: support F2FS_IOC_FS{GET,SET}XATTR")
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
>   fs/f2fs/file.c | 15 ++++++++-------
>   1 file changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> index ca1720fc1187..f25e58680984 100644
> --- a/fs/f2fs/file.c
> +++ b/fs/f2fs/file.c
> @@ -3009,15 +3009,16 @@ int f2fs_transfer_project_quota(struct inode *inode, kprojid_t kprojid)
>   	struct dquot *transfer_to[MAXQUOTAS] = {};
>   	struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
>   	struct super_block *sb = sbi->sb;
> -	int err = 0;
> +	int err;
>   
>   	transfer_to[PRJQUOTA] = dqget(sb, make_kqid_projid(kprojid));
> -	if (!IS_ERR(transfer_to[PRJQUOTA])) {
> -		err = __dquot_transfer(inode, transfer_to);
> -		if (err)
> -			set_sbi_flag(sbi, SBI_QUOTA_NEED_REPAIR);
> -		dqput(transfer_to[PRJQUOTA]);
> -	}
> +	if (IS_ERR(transfer_to[PRJQUOTA]))
> +		return PTR_ERR(transfer_to[PRJQUOTA]);
> +
> +	err = __dquot_transfer(inode, transfer_to);
> +	if (err)
> +		set_sbi_flag(sbi, SBI_QUOTA_NEED_REPAIR);
> +	dqput(transfer_to[PRJQUOTA]);
>   	return err;
>   }
>   


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

      parent reply	other threads:[~2023-03-23 14:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-21 14:45 [f2fs-dev] [PATCH] f2fs: handle dqget error in f2fs_transfer_project_quota() Yangtao Li via Linux-f2fs-devel
2023-03-13 20:20 ` patchwork-bot+f2fs
2023-03-23 14:41 ` Chao Yu [this message]

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=0f1704e5-4a4f-d920-9c69-e01ed2f0dde5@kernel.org \
    --to=chao@kernel.org \
    --cc=frank.li@vivo.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wangshilong1991@gmail.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).