tag name | quota-reservations-5.18_2022-03-10 (7f5bec4d221b624d41cb7871042a0f79ca145a4b) |
tag date | 2022-03-10 13:47:14 -0800 |
tagged by | Darrick J. Wong <djwong@kernel.org> |
tagged object | commit 5e47503127... |
xfs: make quota reservations for directory changes
A couple of weeks ago, I was triaging an unexpected quota counter
failure report coming from xfs_repair after the online repair code
rebuilt a directory. It turned out that the XFS implementation of
linkat does not reserve any quota, which means that a directory
expansion can increase the quota block count beyond the hard limit.
Similar problems exist in the unlink, rmdir, and rename code, so we'll
fix those problems at the same time.
Note: this series does not try to fix a similar bug in the swapext code,
because estimating the necessary quota reservation is very very tricky.
I wrote all that estimation code as the first part of the atomic extent
exchange patchset, so I'll leave that there.
v2: fix unlink and rename, since Dave suggested it
v3: enhance comments, clarify variable names
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEUzaAxoMeQq6m2jMV+H93GTRKtOsFAmIqceIACgkQ+H93GTRK
tOtU8g/9Hy80fo5uIf9DlEZy6ohpp44LUXEfWGCWtSQJzaSM0mHmjyRisDruIalB
ZPmNl5xLXfjimAJJg33WiTBOyhGcCm/0GnsmQ5uzpaW2d4fvylmYawys1PYfjfYV
mbHVLyQAz08ITaaaz7uDxHamWTVaXzFEPsgPGFWkAcBO1nkcZP/xjobJntSVhmjo
Ai1XY6e3EtCLvs9Ml/w+xDrZw76jaEdw3gDmZ+8laHvis2utcBqJ4pmJygjl9i+9
K3vEcle6iZnjcZvyQoq12y5h5SyO97xbgCGSTsx6+DXl3MtUW7hUTTi9J+fFh5GJ
ywDas24HGlAoVCuwZGNAnpI6e4gyjO/zIKE9FE4F2xcBVZZ+HGj0hOJU8dtCh53z
DYMhNwmq0OwBLnRmS/z2HUWfxiyAWa53CldT2Q16OYH6L2I/VtBNex56OEHW+2I8
bAO+0Xcxz5zfznsv2Zx54RJlf7J6n/URRv7/z8uVKAoQfbT7+oXMZ0y5QK93FHbc
3saRXEKhGQQZ28oauAplQ/Plk/nYvIvrpQ7MvkJW6n23yq2+Z8PHOvFRnPAsMSZi
hp8N6JDLJHn/la+ksCDggpGY+gpIYg0AK+3AFeleOLcVe3d98bIoID8A48nuM8CY
mplLQGfyp7JXcny50T7/zxtICzlj5OINApa9W/L6kBbgSbunwZ0=
=9WT4
-----END PGP SIGNATURE-----