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
F108022893: D34680.diff
Mon, Jan 20, 3:30 PM
Unknown Object (File)
Sat, Jan 18, 12:34 AM
Unknown Object (File)
Tue, Jan 14, 2:21 PM
Unknown Object (File)
Mon, Jan 6, 8:05 PM
Unknown Object (File)
Dec 6 2024, 3:59 PM
Unknown Object (File)
Nov 21 2024, 6:46 AM
Unknown Object (File)
Nov 17 2024, 7:09 AM
Unknown Object (File)
Nov 11 2024, 2:04 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