aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_dir2.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-14 10:23:17 -0700
commit41667260bc84db4dfe566e3f6ab6da5293d60d8d (patch)
treeaad2e034f5699eb17f21862fa892ebad42344df1 /fs/xfs/libxfs/xfs_dir2.c
parentxfs: reserve quota for dir expansion when linking/unlinking files (diff)
downloadlinux-dev-41667260bc84db4dfe566e3f6ab6da5293d60d8d.tar.xz
linux-dev-41667260bc84db4dfe566e3f6ab6da5293d60d8d.zip
xfs: reserve quota for target dir expansion when renaming files
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> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_dir2.c')
0 files changed, 0 insertions, 0 deletions