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)
Wed, Nov 13, 11:20 AM
Unknown Object (File)
Tue, Nov 12, 5:28 PM
Unknown Object (File)
Tue, Nov 12, 4:51 PM
Unknown Object (File)
Mon, Nov 4, 11:54 AM
Unknown Object (File)
Oct 13 2024, 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

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.