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: <aab08ad6-22db-44f3-9924-97e096cb0619@kernel.org>
Date: Wed, 7 May 2025 14:28:55 +0800
From: Chao Yu <chao@...nel.org>
To: Christoph Hellwig <hch@....de>, Jaegeuk Kim <jaegeuk@...nel.org>
Cc: chao@...nel.org, linux-f2fs-devel@...ts.sourceforge.net,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/4] f2fs: don't return AOP_WRITEPAGE_ACTIVATE from
 f2fs_write_single_data_page

On 5/5/25 17:25, Christoph Hellwig wrote:
> Instead unlock the pages locally where that would happen and thus
> consolidate the code in the callers.
> 
> Signed-off-by: Christoph Hellwig <hch@....de>
> ---
>  fs/f2fs/compress.c |  5 +----
>  fs/f2fs/data.c     | 13 ++++---------
>  2 files changed, 5 insertions(+), 13 deletions(-)
> 
> diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c
> index e016b0f96313..ce63b3bfb28f 100644
> --- a/fs/f2fs/compress.c
> +++ b/fs/f2fs/compress.c
> @@ -1565,10 +1565,7 @@ static int f2fs_write_raw_pages(struct compress_ctx *cc,
>  						NULL, NULL, wbc, io_type,
>  						compr_blocks, false);
>  		if (ret) {
> -			if (ret == AOP_WRITEPAGE_ACTIVATE) {
> -				folio_unlock(folio);
> -				ret = 0;

Previously, for this case, it will goto out label rather than writing
left pages?

Thanks,

> -			} else if (ret == -EAGAIN) {
> +			if (ret == -EAGAIN) {
>  				ret = 0;
>  				/*
>  				 * for quota file, just redirty left pages to
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index 08a8a107adcb..e32c9cf5b4f5 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -2930,10 +2930,10 @@ int f2fs_write_single_data_page(struct folio *folio, int *submitted,
>  	 * file_write_and_wait_range() will see EIO error, which is critical
>  	 * to return value of fsync() followed by atomic_write failure to user.
>  	 */
> -	if (!err || wbc->for_reclaim)
> -		return AOP_WRITEPAGE_ACTIVATE;
>  	folio_unlock(folio);
> -	return err;
> +	if (err && !wbc->for_reclaim)
> +		return err;
> +	return 0;
>  }
>  
>  /*
> @@ -3146,8 +3146,6 @@ static int f2fs_write_cache_pages(struct address_space *mapping,
>  			ret = f2fs_write_single_data_page(folio,
>  					&submitted, &bio, &last_block,
>  					wbc, io_type, 0, true);
> -			if (ret == AOP_WRITEPAGE_ACTIVATE)
> -				folio_unlock(folio);
>  #ifdef CONFIG_F2FS_FS_COMPRESSION
>  result:
>  #endif
> @@ -3159,10 +3157,7 @@ static int f2fs_write_cache_pages(struct address_space *mapping,
>  				 * keep nr_to_write, since vfs uses this to
>  				 * get # of written pages.
>  				 */
> -				if (ret == AOP_WRITEPAGE_ACTIVATE) {
> -					ret = 0;
> -					goto next;
> -				} else if (ret == -EAGAIN) {
> +				if (ret == -EAGAIN) {
>  					ret = 0;
>  					if (wbc->sync_mode == WB_SYNC_ALL) {
>  						f2fs_io_schedule_timeout(


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ