Summary: | Kernel panics with vfs.nfsd.enable_locallocks=1 and nfs clients doing hdf5 file operations | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Matthew L. Dailey <matthew.l.dailey> | ||||||
Component: | kern | Assignee: | Rick Macklem <rmacklem> | ||||||
Status: | Open --- | ||||||||
Severity: | Affects Some People | CC: | cy, grahamperrin, rmacklem | ||||||
Priority: | --- | Keywords: | crash | ||||||
Version: | 15.0-CURRENT | ||||||||
Hardware: | amd64 | ||||||||
OS: | Any | ||||||||
Attachments: |
|
Description
Matthew L. Dailey
2024-08-21 15:00:46 UTC
Created attachment 252988 [details]
Steps to reproduce panics
Attached are instructions on how to set up a server and client and steps to reproduce the panics.
Just fyi, I have found a place where the code does an msleep() when vfs.nfs.enable_locallocks is 1. This is bad news, since the underlying linked list data structures could change during the msleep(). I haven't yet gotten to the point of coming up with a fix. Until then, I would recommend avoiding setting vfs.nfsd.enable_locallocks to 1. Created attachment 253528 [details]
Fix close handling when vfs.nfsd.enable_locallocks=1
I think this patch might fix the problem.
nfsrv_freeopen() was being called after the mutex
lock was released, making it possible for other
kernel threads to change the lists while nfsrv_freeopen()
took the nfsstateid out of the lists.
This patch moves the code around
"if (nfsrv_freeopen(stp, vp, 1 p) == 0) {"
into nfsrv_freeopen(), so that it can remove the nfsstateid
structure from all lists before unlocking the mutex.
This should avoid any race between CLOSE and other nfsd threads
updating the NFSv4 state.
The patch does not affect the semantics when vfs.nfsd.enable_locallocks=0.
If the reporter can test this patch, that would be great.
(In reply to Rick Macklem from comment #3) Thanks, Rick - this looks promising! I should be able to get a test started today with this patch and see how it goes. Since the panics can take hours or days to happen (sometimes weeks), it may be a while before I can say anything definitive. I'll update this report once I have any results. Sounds good. I won't be able to do commits for about the next 10 days anyhow and it will be a while before the 14.2 release cycle gets going, so this can wait for a few weeks for results. (If it doesn't fix your problem, I will probably still commit it unless you report that it has made things worse.) Thanks, rick |