Page MenuHomeFreeBSD

nfsd: Fix handling of VOP_PATHCONF() for attribute replies
ClosedPublic

Authored by rmacklem on Jul 18 2025, 1:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 12, 11:10 AM
Unknown Object (File)
Sun, Oct 12, 11:10 AM
Unknown Object (File)
Sun, Oct 12, 12:19 AM
Unknown Object (File)
Wed, Oct 8, 8:45 PM
Unknown Object (File)
Thu, Oct 2, 11:17 AM
Unknown Object (File)
Wed, Oct 1, 6:41 AM
Unknown Object (File)
Tue, Sep 30, 6:35 PM
Unknown Object (File)
Tue, Sep 30, 8:51 AM
Subscribers

Details

Summary

des@ reported a panic in the NFSv4 server, where
nfsv4_fillattr() did a VOP_PATHCONF() without having
"vp" locked. kib@ suggested D51398 to fix it.

I think for the case of Readdirplus reply, relocking the
vnode can cause deadlocks. As such, this patch handles
VOP_PATHCONF() in the same way that the code checks
for ACL support, by doing the VOP_PATHCONF() before
the calls to nfsv4_filllattr() where the vnode is still locked.

des@, please test.

Test Plan

Tested when running a kernel with DEBUG_VFS_LOCKS
option enabled.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

kib added inline comments.
sys/fs/nfsserver/nfs_nfsdport.c
2952

You can write these two lines as

has_hiddensystem = pathval > 0;
2957

Similarly there.

sys/fs/nfsserver/nfs_nfsdserv.c
318

Even better there.

This revision is now accepted and ready to land.Jul 18 2025, 10:51 PM

I am unable to apply this patch. If possible, please regenerate it using git arc update.

In D51410#1174312, @des wrote:

I am unable to apply this patch. If possible, please regenerate it using git arc update.

It is now in main as 392a82b2.

Commit has been done. Didn't automagically close for
some reason?

Commit has been done. Didn't automagically close for some reason?

You misspelled the metadata in the commit. Please use git arc in the future.

In D51410#1174435, @des wrote:

Commit has been done. Didn't automagically close for some reason?

You misspelled the metadata in the commit. Please use git arc in the future.

The line in git log is:
Differential Revision: https://reviews.freebsd.org/D51410
looks ok to me?