HomeFreeBSD

nfsd: Fix handling of NFSv4 setable attributes

Description

nfsd: Fix handling of NFSv4 setable attributes

Commit d8a5961 made a change to nfsv4_sattr() that broke
parsing of the setable attributes for a NFSv4 SETATTR.
(It broke out of the code by setting "error" and returning
right away, instead of noting the error in nd_repstat and
allowing parsing of the attributes to continue.)
By returning prematurely, it was possible for SETATTR to return
the error, but with a bogus set of attribute bits set, since
"retbits" had not yet been set to all zeros.
(I am not sure if any client could be affected by this bug.
The patch was done for a failure case detected by a pynfs test
suite and not an actual client.)

While here, the patch also fixes a
few cases where the value of attributes gets set for attributes
after an error has been set in nd_repstat. This would not really
break the protocol, since a SETATTR is allowed to set some attributes
and still return an failure, but should not really be done.

MFC after: 2 weeks

Details

Provenance
rmacklemAuthored on Aug 27 2024, 9:19 PM
Parents
rGfe66e4caf456: rangelock: Disable cheat mode by default
Branches
Unknown
Tags
Unknown