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]
Date:   Mon, 19 Jun 2023 11:56:04 +0200
From:   Jan Kara <jack@...e.cz>
To:     Bean Huo <beanhuo@...pp.de>
Cc:     viro@...iv.linux.org.uk, brauner@...nel.org,
        akpm@...ux-foundation.org, jack@...e.cz, jack@...e.com,
        tytso@....edu, adilger.kernel@...ger.ca, mark@...heh.com,
        jlbec@...lplan.org, joseph.qi@...ux.alibaba.com,
        linux-ext4@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        linux-kernel@...r.kernel.org, ocfs2-devel@....oracle.com,
        beanhuo@...ron.com
Subject: Re: [PATCH v1 2/5] fs/buffer.c: convert block_commit_write to return
 void

On Sun 18-06-23 23:32:47, Bean Huo wrote:
> From: Bean Huo <beanhuo@...ron.com>
> 
> block_commit_write() always returns 0, this patch changes it to
> return void.
> 
> Signed-off-by: Bean Huo <beanhuo@...ron.com>

Looks good to me but you'll need to reorder this patch at the end of the
patch series to avoid breaking compilation in the middle of the series.
Otherwise feel free to add:

Reviewed-by: Jan Kara <jack@...e.cz>

								Honza

> ---
>  fs/buffer.c                 | 11 +++++------
>  include/linux/buffer_head.h |  2 +-
>  2 files changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/fs/buffer.c b/fs/buffer.c
> index b88bb7ec38be..fa09cf94f771 100644
> --- a/fs/buffer.c
> +++ b/fs/buffer.c
> @@ -2116,7 +2116,7 @@ int __block_write_begin(struct page *page, loff_t pos, unsigned len,
>  }
>  EXPORT_SYMBOL(__block_write_begin);
>  
> -int block_commit_write(struct page *page, unsigned int from, unsigned int to)
> +void block_commit_write(struct page *page, unsigned int from, unsigned int to)
>  {
>  	unsigned block_start, block_end;
>  	int partial = 0;
> @@ -2151,7 +2151,6 @@ int block_commit_write(struct page *page, unsigned int from, unsigned int to)
>  	 */
>  	if (!partial)
>  		SetPageUptodate(page);
> -	return 0;
>  }
>  EXPORT_SYMBOL(block_commit_write);
>  
> @@ -2577,11 +2576,11 @@ int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf,
>  		end = PAGE_SIZE;
>  
>  	ret = __block_write_begin(page, 0, end, get_block);
> -	if (!ret)
> -		ret = block_commit_write(page, 0, end);
> -
> -	if (unlikely(ret < 0))
> +	if (unlikely(ret))
>  		goto out_unlock;
> +
> +	block_commit_write(page, 0, end);
> +
>  	set_page_dirty(page);
>  	wait_for_stable_page(page);
>  	return 0;
> diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
> index 1520793c72da..873653d2f1aa 100644
> --- a/include/linux/buffer_head.h
> +++ b/include/linux/buffer_head.h
> @@ -284,7 +284,7 @@ int cont_write_begin(struct file *, struct address_space *, loff_t,
>  			unsigned, struct page **, void **,
>  			get_block_t *, loff_t *);
>  int generic_cont_expand_simple(struct inode *inode, loff_t size);
> -int block_commit_write(struct page *page, unsigned from, unsigned to);
> +void block_commit_write(struct page *page, unsigned int from, unsigned int to);
>  int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf,
>  				get_block_t get_block);
>  /* Convert errno to return value from ->page_mkwrite() call */
> -- 
> 2.34.1
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ