]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
vfs: Fix "emptydir" mount option
authorOlivier Certner <olce.freebsd@certner.fr>
Sat, 22 Apr 2023 16:07:07 +0000 (18:07 +0200)
committerKonstantin Belousov <kib@FreeBSD.org>
Fri, 28 Apr 2023 01:27:54 +0000 (04:27 +0300)
commit6450e7bbad0c68176f28b51773a3af5d6022c7dd
treed03d5ab99cadc28a6125fd45ecde7c2ec34fed73
parent3d8450db4c603d18aa45422159170e133c95214d
vfs: Fix "emptydir" mount option

Fix vfs_emptydir(). It would consider directories containing directories
with name of the form 'X.' (X being any authorized byte) as empty. Also,
it would cause VOP_READDIR() to return an error on directories
containing enough whiteouts. While here, use a more decently sized
buffer as done elsewhere.

Remove ad-hoc iteration on the directory's content and instead use the
newly exported vn_dir_next_dirent() function (this is what fixes the
second problem mentioned above).

PR: 270988
Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39775
sys/kern/vfs_subr.c