]> 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, 12 May 2021 02:38:42 +0000 (19:38 -0700)
commit8686e00fdfac505cded6d8f4a4bcf8e51fc10349
treeb0b37117bdb11f75af8f602b7cf98c88bbb029b1
parent44d99af3c545398c5bbc01b20c611fe63ccdad76
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)
sys/fs/nfsclient/nfs_clnode.c
sys/fs/nfsclient/nfs_clstate.c