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: <20250625-erstklassig-stilvoll-273282f0dd1b@brauner>
Date: Wed, 25 Jun 2025 10:04:22 +0200
From: Christian Brauner <brauner@...nel.org>
To: Matthew Wilcox <willy@...radead.org>
Cc: 陈涛涛 Taotao Chen <chentaotao@...iglobal.com>, 
	"tytso@....edu" <tytso@....edu>, "hch@...radead.org" <hch@...radead.org>, 
	"adilger.kernel@...ger.ca" <adilger.kernel@...ger.ca>, "jani.nikula@...ux.intel.com" <jani.nikula@...ux.intel.com>, 
	"rodrigo.vivi@...el.com" <rodrigo.vivi@...el.com>, "tursulin@...ulin.net" <tursulin@...ulin.net>, 
	"airlied@...il.com" <airlied@...il.com>, "linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>, 
	"linux-ext4@...r.kernel.org" <linux-ext4@...r.kernel.org>, "linux-block@...r.kernel.org" <linux-block@...r.kernel.org>, 
	"intel-gfx@...ts.freedesktop.org" <intel-gfx@...ts.freedesktop.org>, 
	"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>, "linux-mm@...ck.org" <linux-mm@...ck.org>, 
	"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>, "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, 
	"chentao325@...com" <chentao325@...com>
Subject: Re: [PATCH v2 3/5] fs: change write_begin/write_end interface to
 take struct kiocb *

On Tue, Jun 24, 2025 at 01:51:51PM +0100, Matthew Wilcox wrote:
> On Tue, Jun 24, 2025 at 12:12:08PM +0000, 陈涛涛 Taotao Chen wrote:
> > -static int blkdev_write_end(struct file *file, struct address_space *mapping,
> > +static int blkdev_write_end(struct kiocb *iocb, struct address_space *mapping,
> >  		loff_t pos, unsigned len, unsigned copied, struct folio *folio,
> >  		void *fsdata)
> >  {
> >  	int ret;
> > -	ret = block_write_end(file, mapping, pos, len, copied, folio, fsdata);
> > +	ret = block_write_end(iocb->ki_filp, mapping, pos, len, copied, folio, fsdata);
> 
> ... huh.  I thought block_write_end() had to have the same prototype as
> ->write_end because it was used by some filesystems as the ->write_end.
> I see that's not true (any more?).  Maybe I was confused with
> generic_write_end().  Anyway, block_write_end() doesn't use it's file
> argument, and never will, so we can just remove it.
> 
> > +++ b/include/linux/fs.h
> > @@ -446,10 +446,10 @@ struct address_space_operations {
> >  
> >  	void (*readahead)(struct readahead_control *);
> >  
> > -	int (*write_begin)(struct file *, struct address_space *mapping,
> > +	int (*write_begin)(struct kiocb *, struct address_space *mapping,
> >  				loff_t pos, unsigned len,
> >  				struct folio **foliop, void **fsdata);
> > -	int (*write_end)(struct file *, struct address_space *mapping,
> > +	int (*write_end)(struct kiocb *, struct address_space *mapping,
> >  				loff_t pos, unsigned len, unsigned copied,
> >  				struct folio *folio, void *fsdata);
> 
> Should we make this a 'const struct kiocb *'?  I don't see a need for
> filesystems to be allowed to modify the kiocb in future, but perhaps
> other people have different opinions.

Given I picked up Willy's change I'll wait for a resubmit of this series
on top of vfs-6.17.misc unless I hear otherwise?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ