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] [thread-next>] [day] [month] [year] [list]
Message-ID: <52ced02d-728b-4e3b-9079-73efd91c90e3@kernel.org>
Date: Mon, 2 Sep 2024 15:32:33 +0800
From: Chao Yu <chao@...nel.org>
To: wangzijie <wangzijie1@...or.com>, jaegeuk@...nel.org
Cc: linux-f2fs-devel@...ts.sourceforge.net, linux-kernel@...r.kernel.org,
 bintian.wang@...or.com
Subject: Re: [RFC PATCH] f2fs: don't set SBI_QUOTA_NEED_REPAIR flag if receive
 SIGKILL

On 2024/8/27 14:22, wangzijie wrote:
> Thread A
> -dquot_initialize
>   -dqget
>    -f2fs_dquot_acquire
>     -v2_read_dquot
>      -qtree_read_dquot
>       -find_tree_dqentry
>        -f2fs_quota_read
>         -read_cache_page_gfp
>          -do_read_cache_folio
>           -fiemap_read_folio
>            -folio_wait_locked_killable
>             -receive SIGKILL : return -EINTR
>         -set SBI_QUOTA_NEED_REPAIR
>     -set SBI_QUOTA_NEED_REPAIR
> 
> When calling read_cache_page_gfp in quota read, thread may receive SIGKILL and
> set SBI_QUOTA_NEED_REPAIR, should we set SBI_QUOTA_NEED_REPAIR in this error path?

f2fs_quota_read() can be called in a lot of contexts, can we just ignore -EINTR
for f2fs_dquot_initialize() case?

Thanks,

> 
> Signed-off-by: wangzijie <wangzijie1@...or.com>
> ---
>   fs/f2fs/inode.c | 3 ++-
>   fs/f2fs/super.c | 6 +++---
>   2 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
> index ed629dabb..2af98e2b7 100644
> --- a/fs/f2fs/inode.c
> +++ b/fs/f2fs/inode.c
> @@ -837,8 +837,9 @@ void f2fs_evict_inode(struct inode *inode)
>   
>   	err = f2fs_dquot_initialize(inode);
>   	if (err) {
> +		if (err != -EINTR)
> +			set_sbi_flag(sbi, SBI_QUOTA_NEED_REPAIR);
>   		err = 0;
> -		set_sbi_flag(sbi, SBI_QUOTA_NEED_REPAIR);
>   	}
>   
>   	f2fs_remove_ino_entry(sbi, inode->i_ino, APPEND_INO);
> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> index 1f1b3647a..f99a36ff3 100644
> --- a/fs/f2fs/super.c
> +++ b/fs/f2fs/super.c
> @@ -2650,8 +2650,8 @@ static ssize_t f2fs_quota_read(struct super_block *sb, int type, char *data,
>   			if (PTR_ERR(page) == -ENOMEM) {
>   				memalloc_retry_wait(GFP_NOFS);
>   				goto repeat;
> -			}
> -			set_sbi_flag(F2FS_SB(sb), SBI_QUOTA_NEED_REPAIR);
> +			} else if (PTR_ERR(page) != -EINTR)
> +				set_sbi_flag(F2FS_SB(sb), SBI_QUOTA_NEED_REPAIR);
>   			return PTR_ERR(page);
>   		}
>   
> @@ -3070,7 +3070,7 @@ static int f2fs_dquot_acquire(struct dquot *dquot)
>   
>   	f2fs_down_read(&sbi->quota_sem);
>   	ret = dquot_acquire(dquot);
> -	if (ret < 0)
> +	if (ret < 0 && ret != -EINTR)
>   		set_sbi_flag(sbi, SBI_QUOTA_NEED_REPAIR);
>   	f2fs_up_read(&sbi->quota_sem);
>   	return ret;


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ