opnsense-src/sys/fs/tmpfs
Jason A. Harmening 8fa5e0f21f tmpfs: Account for whiteouts during rename/rmdir
The existing tmpfs implementation will return ENOTEMPTY for VOP_RMDIR,
or for the destination directory of VOP_RENAME, for any case in which
the directory is non-empty, even if the directory only contains
whiteouts.

Fix this by tracking total whiteout dirent allocation separately for
each directory, and avoid returning ENOTEMPTY if IGNOREWHITEOUT has
been specified by the caller and the total allocation of dirents is not
greater than the total whiteout allocation.  This addresses "directory
not empty" failures seen on some recently-added unionfs stress2 tests
which use tmpfs as a base-layer filesystem.

A separate issue for independent consideration is that unionfs' default
behavior when deleting files or directories is to create whiteouts even
when it does not truly need to do so.

Differential Revision:  https://reviews.freebsd.org/D45987
Reviewed by:		kib (prior version), olce
Tested by:		pho
2024-09-08 18:34:15 -05:00
..
tmpfs.h tmpfs: Account for whiteouts during rename/rmdir 2024-09-08 18:34:15 -05:00
tmpfs_fifoops.c sys: Remove $FreeBSD$: two-line .c pattern 2023-08-16 11:54:30 -06:00
tmpfs_fifoops.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
tmpfs_subr.c tmpfs: Account for whiteouts during rename/rmdir 2024-09-08 18:34:15 -05:00
tmpfs_vfsops.c vm: Remove kernel stack swapping support, part 3 2024-07-29 01:39:49 +00:00
tmpfs_vnops.c tmpfs: Account for whiteouts during rename/rmdir 2024-09-08 18:34:15 -05:00
tmpfs_vnops.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00