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
Unknown Object (File)
Mon, Apr 7, 3:10 AM
Unknown Object (File)
Mon, Mar 17, 2:15 AM
Unknown Object (File)
Sun, Mar 16, 11:54 PM
Unknown Object (File)
Mar 12 2025, 2:24 PM
Unknown Object (File)
Mar 10 2025, 2:09 AM
Unknown Object (File)
Feb 4 2025, 11:22 PM
Unknown Object (File)
Jan 20 2025, 3:30 PM
Unknown Object (File)
Jan 18 2025, 12:34 AM

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