summaryrefslogtreecommitdiff
path: root/fs/btrfs/file-item.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-03-09 10:10:50 -0800
committerDarrick J. Wong <djwong@kernel.org>2022-03-10 13:47:05 -0800
commit5e47503127530c34797e804234157d067738f2d3 (patch)
tree0185c2dcfd156b86fee9a4294ecc04dd1541c738 /fs/btrfs/file-item.c
parent4a8ee6fb5438cde5dd4cf45a8a08ee90e37d1a7c (diff)
xfs: reserve quota for target dir expansion when renaming filesquota-reservations-5.18_2022-03-10
XFS does not reserve quota for directory expansion when renaming children into a directory. This means that we don't reject the expansion with EDQUOT when we're at or near a hard limit, which means that unprivileged userspace can use rename() to exceed quota. Rename operations don't always expand the target directory, and we allow a rename to proceed with no space reservation if we don't need to add a block to the target directory to handle the addition. Moreover, the unlink operation on the source directory generally does not expand the directory (you'd have to free a block and then cause a btree split) and it's probably of little consequence to leave the corner case that renaming a file out of a directory can increase its size. As with link and unlink, there is a further bug in that we do not trigger the blockgc workers to try to clear space when we're out of quota. Because rename is its own special tricky animal, we'll patch xfs_rename directly to reserve quota to the rename transaction. We'll leave cleaning up the rest of xfs_rename for the metadata directory tree patchset. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/btrfs/file-item.c')
0 files changed, 0 insertions, 0 deletions