fusefs: fix list size calculation bug in fuse_vnop_listextattr
A small error in r338152 let to the returned size always being exactly eight
bytes too large.
Differential D21287
fusefs: fix list size calculation bug in fuse_vnop_listextattr asomers on Aug 16 2019, 4:50 AM. Authored by Tags None Referenced Files
Details fusefs: fix list size calculation bug in fuse_vnop_listextattr A small error in r338152 let to the returned size always being exactly eight
Diff Detail
Event TimelineComment Actions Ohh, I just realized the purpose of line 2321. I'll fix the review in the morning.
Comment Actions Handle a race condition in fuse_vnop_listextattr fuse_vnop_listextattr is fundamentally racy. Due to FreeBSD/Linux API This update fixes three things:
Comment Actions Sorry about the long delay — life has been busy. This change looks like a step in the right direction, thanks! I added some suggestions below. I didn't look at the test changes; I don't have any familiarity with googletest (or the C++ constructs used), so I'll take your word for those.
Comment Actions Accomodate buggy or malicious fuse servers that always return ERANGE for Comment Actions This approach looks technically correct to me, and it simplifies the logic, but there is definitely some microbenchmark cost to exiting to userspace every retry instead of doing so "a few times" in the kernel (with some algorithm). But this is maybe just premature optimization on my part. (Signals must be able to abort fdisp_wait_answ already, right? Otherwise a malicious FUSE filesystem could just not respond to tickets and tip over the kernel...) Comment Actions Yeah, I choose the simpler solution because I didn't think that the race would be common enough to be worth optimizing for.
SIGKILL is always allowed to interrupt fdisp_wait_answ. Whether other signals can depends on the -o intr mount option and whether the specific file system supports the FUSE_INTERRUPT operation. |