Page MenuHomeFreeBSD

vfs: Fix "emptydir" mount option
ClosedPublic

Authored by olce on Apr 24 2023, 9:09 AM.
Tags
None
Referenced Files
F102467145: D39775.diff
Tue, Nov 12, 4:51 PM
Unknown Object (File)
Mon, Nov 4, 11:54 AM
Unknown Object (File)
Sun, Oct 13, 5:37 PM
Unknown Object (File)
Sep 30 2024, 2:32 PM
Unknown Object (File)
Sep 25 2024, 9:23 PM
Unknown Object (File)
Sep 25 2024, 9:16 PM
Unknown Object (File)
Sep 22 2024, 2:03 PM
Unknown Object (File)
Sep 21 2024, 6:45 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 Passed
Unit
No Test Coverage
Build Status
Buildable 51173
Build 48064: arc lint + arc unit

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
6412

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.