]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
nfscl: add check for NULL clp and forced dismounts to nfscl_delegreturnvp()
authorRick Macklem <rmacklem@FreeBSD.org>
Wed, 28 Apr 2021 00:30:16 +0000 (17:30 -0700)
committerRick Macklem <rmacklem@FreeBSD.org>
Wed, 28 Apr 2021 00:30:16 +0000 (17:30 -0700)
commitf6fec55fe30088bbefd3efe70b62565399a7b9b8
tree948f5feaa06f80e6218b0a682677efea9bb6ab29
parentdb8c27f499105dcc9872dcc46e88bdd570c24fee
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
Reported by: ish@amail.plala.or.jp
MFC after: 2 weeks
sys/fs/nfsclient/nfs_clnode.c
sys/fs/nfsclient/nfs_clstate.c