Re: [Cluster-devel] [PATCH v6 1/7] fs: pass the request_mask to generic_fillattr

Jeff Layton <[email protected]> Tue, 29 Aug 2023 20:43:31 -0400
Newsgroups com.redhat.cluster-devel,dev.linux.lists.ntfs3,dev.linux.lists.ocfs2-devel,dev.linux.lists.v9fs,net.sourceforge.lists.linux-f2fs-devel,org.infradead.lists.linux-mtd,org.kernel.vger.ceph-devel,org.kernel.vger.ecryptfs,org.kernel.vger.linux-btrfs,org.kernel.vger.linux-cifs,org.kernel.vger.linux-ext4,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-nfs,org.kernel.vger.linux-xfs,org.kvack.linux-mm,org.ozlabs.lists.linux-erofs
Message-ID <[email protected]>
On Wed, 2023-08-30 at 01:02 +0100, Al Viro wrote:
> On Tue, Aug 29, 2023 at 06:58:47PM -0400, Jeff Layton wrote:
> > On Tue, 2023-08-29 at 23:44 +0100, Al Viro wrote:
> > > On Tue, Jul 25, 2023 at 10:58:14AM -0400, Jeff Layton wrote:
> > > > generic_fillattr just fills in the entire stat struct indiscriminat=
ely
> > > > today, copying data from the inode. There is at least one attribute
> > > > (STATX_CHANGE_COOKIE) that can have side effects when it is reporte=
d,
> > > > and we're looking at adding more with the addition of multigrain
> > > > timestamps.
> > > >=20
> > > > Add a request_mask argument to generic_fillattr and have most calle=
rs
> > > > just pass in the value that is passed to getattr. Have other caller=
s
> > > > (e.g. ksmbd) just pass in STATX_BASIC_STATS. Also move the setting =
of
> > > > STATX_CHANGE_COOKIE into generic_fillattr.
> > >=20
> > > Out of curiosity - how much PITA would it be to put request_mask into
> > > kstat?  Set it in vfs_getattr_nosec() (and those get_file_..._info()
> > > on smbd side) and don't bother with that kind of propagation boilerpl=
ate
> > > - just have generic_fillattr() pick it there...
> > >=20
> > > Reduces the patchset size quite a bit...
> >=20
> > It could be done. To do that right, I think we'd want to drop
> > request_mask from the ->getattr prototype as well and just have
> > everything use the mask in the kstat.
> >=20
> > I don't think it'd reduce the size of the patchset in any meaningful
> > way, but it might make for a more sensible API over the long haul.
>=20
> ->getattr() prototype change would be decoupled from that - for your
> patchset you'd only need the field addition + setting in vfs_getattr_nose=
c()
> (and possibly in ksmbd), with the remainders of both series being
> independent from each other.
>=20
> What I suggest is
>=20
> branchpoint -> field addition (trivial commit) -> argument removal
> =09=09|
> =09=09V
> your series, starting with "use stat->request_mask in generic_fillattr()"
>=20
> Total size would be about the same, but it would be easier to follow
> the less trivial part of that.  Nothing in your branch downstream of
> that touches any ->getattr() instances, so it should have no
> conflicts with the argument removal side of things.

The only problem with this plan is that Linus has already merged this.
I've no issue with adding the request_mask to the kstat and removing it
as a separate parameter elsewhere, but I think we'll need to do it on
top of what's already been merged.
--=20
Jeff Layton <[email protected]>