lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 23 Mar 2023 22:41:52 +0800
From:   Chao Yu <chao@...nel.org>
To:     Wang Shilong <wangshilong1991@...il.com>,
        Yangtao Li <frank.li@...o.com>
Cc:     linux-f2fs-devel@...ts.sourceforge.net,
        linux-kernel@...r.kernel.org, jaegeuk@...nel.org
Subject: Re: [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@...o.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;
>   }
>   

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ