All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET 0/2] xfs: use setattr_copy to set VFS file attributes
@ 2022-03-09 19:22 Darrick J. Wong
  2022-03-09 19:22 ` [PATCH 1/2] xfs: use setattr_copy to set vfs inode attributes Darrick J. Wong
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Darrick J. Wong @ 2022-03-09 19:22 UTC (permalink / raw)
  To: djwong; +Cc: linux-xfs, fdmanana, andrey.zhadchenko, brauner, david, hch

Hi all,

A few weeks ago, Filipe Manana reported[1] that the new generic/673 test
fails on btrfs because btrfs is more aggressive about dropping the
setgid bit when reflinking into a file.  After some more digging, we
discovered that btrfs calls the VFS helpers to handle updating VFS
inode attributes, whereas XFS has open-coded logic dating from ~1997
that have not been kept up to date.

A few days later, Andrey Zhadchenko reported[2] that XFS can mistakenly
clear S_ISUID and S_ISGID on idmapped mounts.  After further discussion,
it was pointed out that the VFS already handles all these fiddly file
mode changes, and that it was the XFS implementation that is out of
date.

Both of these reports resolve to the same cause, which is that XFS needs
to call setattr_copy to update i_mode instead of doing it directly.
This series replaces all of our bespoke code with VFS calls to fix the
problem and reduce the size of the codebase by ~70 lines.

[1] https://lore.kernel.org/linux-xfs/CAL3q7H47iNQ=Wmk83WcGB-KBJVOEtR9+qGczzCeXJ9Y2KCV25Q@mail.gmail.com/
[2] https://lore.kernel.org/linux-xfs/20220221182218.748084-1-andrey.zhadchenko@virtuozzo.com/

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This is an extraordinary way to destroy everything.  Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=setattr-copy-5.18
---
 fs/xfs/xfs_iops.c |  116 +++++++++++------------------------------------------
 fs/xfs/xfs_pnfs.c |    3 +
 2 files changed, 25 insertions(+), 94 deletions(-)


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-03-11  7:55 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-09 19:22 [PATCHSET 0/2] xfs: use setattr_copy to set VFS file attributes Darrick J. Wong
2022-03-09 19:22 ` [PATCH 1/2] xfs: use setattr_copy to set vfs inode attributes Darrick J. Wong
2022-03-09 21:22   ` Dave Chinner
2022-03-10  8:07   ` Christoph Hellwig
2022-03-10 10:11   ` Christian Brauner
2022-03-10 17:34     ` Darrick J. Wong
2022-03-11  7:54       ` Christian Brauner
2022-03-09 19:22 ` [PATCH 2/2] xfs: refactor user/group quota chown in xfs_setattr_nonsize Darrick J. Wong
2022-03-09 21:25   ` Dave Chinner
2022-03-10  8:10   ` Christoph Hellwig
2022-03-10  9:59   ` Christian Brauner
2022-03-09 23:01 ` [PATCHSET 0/2] xfs: use setattr_copy to set VFS file attributes Andrey Zhadchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.