Page MenuHomeFreeBSD

getdirentries: return ENOENT for unlinked but still open directory.
ClosedPublic

Authored by dchagin on Mar 26 2022, 5:23 PM.
Tags
None
Referenced Files
F149796112: D34680.diff
Fri, Mar 27, 4:19 AM
F149779144: D34680.id104234.diff
Fri, Mar 27, 12:52 AM
F149736518: D34680.diff
Thu, Mar 26, 3:52 PM
Unknown Object (File)
Thu, Mar 26, 2:41 AM
Unknown Object (File)
Wed, Mar 25, 4:11 AM
Unknown Object (File)
Tue, Mar 24, 8:16 AM
Unknown Object (File)
Tue, Mar 24, 3:32 AM
Unknown Object (File)
Mon, Mar 16, 7:41 PM

Diff Detail

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

Event Timeline

mjg added inline comments.
sys/kern/vfs_syscalls.c
3960

rmdir might have failed, but also this is not the place to do it. it should be in vop_rmdir_post

sys/kern/vfs_syscalls.c
3960

the flag itself is only used by gjournal, so a new one would have to be introduced for this purpose (VV_UNLINKED?)

Other than that, English LGTM. Can't vouch for content.

lib/libc/sys/getdirentries.2
197

I'd be more specific here, maybe by repeating "unlinked but still open directory".

Also, while touching this area, I'd mention that getdents() has the same errno values (if it does).

This revision now requires changes to proceed.Mar 26 2022, 11:03 PM
sys/kern/vfs_subr.c
5987

again you need to error check -- move it into the !rc case

sys/kern/vfs_syscalls.c
4198

i guess __predict_false on this would not hurt

ah, fixed, thank you, Mateusz

This revision is now accepted and ready to land.Mar 27 2022, 9:14 PM