HomeFreeBSD

nfscl: add check for NULL clp and forced dismounts to nfscl_delegreturnvp()

Description

nfscl: add check for NULL clp and forced dismounts to nfscl_delegreturnvp()

Commit aad780464fad added a function called nfscl_delegreturnvp()
to return delegations during the NFS VOP_RECLAIM().
The function erroneously assumed that nm_clp would
be non-NULL. It will be NULL for NFSV4.0 mounts until
a regular file is opened. It will also be NULL during
vflush() in nfs_unmount() for a forced dismount.

This patch adds a check for clp == NULL to fix this.

Also, since it makes no sense to call nfscl_delegreturnvp()
during a forced dismount, the patch adds a check for that
case and does not do the call during forced dismounts.

PR: 255436
(cherry picked from commit f6fec55fe30088bbefd3efe70b62565399a7b9b8)

Details

Provenance
rmacklemAuthored on Apr 28 2021, 12:30 AM
Parents
rG44d99af3c545: nfscl: return delegations in the NFS VOP_RECLAIM()
Branches
Unknown
Tags
Unknown