tag name | setattr-copy-5.18_2022-03-10 (c077b518054b691260b39a0382f6e199dc26ac67) |
tag date | 2022-03-10 13:47:08 -0800 |
tagged by | Darrick J. Wong <djwong@kernel.org> |
tagged object | commit 7f7849b4c1... |
xfs: use setattr_copy to set VFS file attributes
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/
v2: fix Fixes tag, add review tags
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEUzaAxoMeQq6m2jMV+H93GTRKtOsFAmIqcdwACgkQ+H93GTRK
tOv4zg/8Cn4IfFdYo+3S+hubECGBOhrJg7oyVk/V3vqOuRAp6suP4u9yKDLh95eV
O/C7PPOlNuDW3qx12cSzub/jFMf/Y9WBKrKhY24u3hR+5ZkPs7C8oLbWLTxj1yFj
zIiEkuTS7jvPwYaIVVTuyMlQKzeHRXx7zl2+QZLNdbDNQvkFO5eaIX56Jgg4oOAa
xSRCQ1Pj0c02Y/HJ58ls9eFP8UbKXzRhirrnw+q2neeuAis2ElEM172GTC9SrnhO
VrWoWscO5ubday6yAskQfHKnOPMWFja8PIqVRHQi5ZL7qnFwP5x2SlOHesu7z/LT
OZD/n9NGgfch/jglLHRY14V4wcGZKFaoeCEhEShAZThg2HGxC3C58l0qi6LztW1n
US4DgzKt4Tg3cPOHby6n8NMbDNCaSpq9B6ixT5tH7OEXEdd2WtE7Z6TehGEOsMZr
ZSP7Dz6W+x1cnux9HPoEssdVdMEl0j5ffn3IRXsEMqG+o/0aNrI4+L6rznFQ7nvS
BGv5f7/nOpDUplZR/7zqEpAnaMu20ViynZfIbzaFkFkWP/l7Z64pWebLtWM8rlZi
b16AGC2cdsZUeC03ZEjbjQvYT2auuzQi1JE4U95RVvSxeFzrB7zRa3leCKaBBFb2
mkv1Y9rqxTISLeB/rXVT+RnmsdQSBvOdlHQug2smIaAtsTmGrcM=
=i+US
-----END PGP SIGNATURE-----