lkml.org 
[lkml]   [2023]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] f2fs: handle dqget error in f2fs_transfer_project_quota()
+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;
> }
>

\
 
 \ /
  Last update: 2023-03-27 01:15    [W:0.018 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site