Page MenuHomeFreeBSD

vfs: Fix "emptydir" mount option
ClosedPublic

Authored by olce on Apr 24 2023, 9:09 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 9, 8:12 PM
Unknown Object (File)
Feb 10 2024, 11:41 PM
Unknown Object (File)
Dec 26 2023, 11:07 AM
Unknown Object (File)
Dec 26 2023, 11:07 AM
Unknown Object (File)
Dec 24 2023, 8:01 PM
Unknown Object (File)
Dec 20 2023, 8:35 AM
Unknown Object (File)
Dec 12 2023, 5:09 PM
Unknown Object (File)
Nov 19 2023, 6:00 AM

Details

Summary

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).

Test Plan

Manually tested (UFS, ZFS).

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

olce requested review of this revision.Apr 24 2023, 9:09 AM
olce created this revision.

I slightly prefer the previous way of loop organization, where the end label and gotos are not used, but I do not insist.

sys/kern/vfs_subr.c
6407

The cast is redundant.

6430

Style requires multi-line comments to be of the form

/*
 * Comment text
 * more of it
 */
olce marked 2 inline comments as done.

Comments addressed.

sys/kern/vfs_subr.c
6444

Still the wrong style (I did not marked each style violation, only some instances).

olce marked an inline comment as done.Apr 26 2023, 1:41 PM

Please mail me all three patches formatted with git, and with right metadata: author, commit summary, and tag for the corresponding review ('Differential revision: <url>'). Thank you.

This revision is now accepted and ready to land.Apr 27 2023, 1:34 AM
This revision was automatically updated to reflect the committed changes.