diff options
author | Rick Macklem <rmacklem@FreeBSD.org> | 2017-07-29 19:52:47 +0000 |
---|---|---|
committer | Rick Macklem <rmacklem@FreeBSD.org> | 2017-07-29 19:52:47 +0000 |
commit | 47cbff34fa9a88fc8c12c4de15882a0563a33055 (patch) | |
tree | aa3367f7e70e9c66d04fd0ade1463d1b6ee266a1 /sys/nfs | |
parent | d35f6548e63e5deb4e9a7ac40f517fc10b1dc7b9 (diff) | |
download | src-47cbff34fa9a88fc8c12c4de15882a0563a33055.tar.gz src-47cbff34fa9a88fc8c12c4de15882a0563a33055.zip |
Add kernel support for the NFS client forced dismount "umount -N" option.
When an NFS mount is hung against an unresponsive NFS server, the "umount -f"
option can be used to dismount the mount. Unfortunately, "umount -f" gets
hung as well if a "umount" without "-f" has already been done. Usually,
this is because of a vnode lock being held by the "umount" for the mounted-on
vnode.
This patch adds kernel code so that a new "-N" option can be added to "umount",
allowing it to avoid getting hung for this case.
It adds two flags. One indicates that a forced dismount is about to happen
and the other is used, along with setting mnt_data == NULL, to handshake
with the nfs_unmount() VFS call.
It includes a slight change to the interface used between the client and
common NFS modules, so I bumped __FreeBSD_version to ensure both modules are
rebuilt.
Tested by: pho
Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D11735
Notes
Notes:
svn path=/head/; revision=321688
Diffstat (limited to 'sys/nfs')
-rw-r--r-- | sys/nfs/nfs_nfssvc.c | 2 | ||||
-rw-r--r-- | sys/nfs/nfssvc.h | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/sys/nfs/nfs_nfssvc.c b/sys/nfs/nfs_nfssvc.c index 1f2cdaf3f9d8..8c49a61f808c 100644 --- a/sys/nfs/nfs_nfssvc.c +++ b/sys/nfs/nfs_nfssvc.c @@ -92,7 +92,7 @@ sys_nfssvc(struct thread *td, struct nfssvc_args *uap) nfsd_call_nfsserver != NULL) error = (*nfsd_call_nfsserver)(td, uap); else if ((uap->flag & (NFSSVC_CBADDSOCK | NFSSVC_NFSCBD | - NFSSVC_DUMPMNTOPTS)) && nfsd_call_nfscl != NULL) + NFSSVC_DUMPMNTOPTS | NFSSVC_FORCEDISM)) && nfsd_call_nfscl != NULL) error = (*nfsd_call_nfscl)(td, uap); else if ((uap->flag & (NFSSVC_IDNAME | NFSSVC_GETSTATS | NFSSVC_GSSDADDPORT | NFSSVC_GSSDADDFIRST | NFSSVC_GSSDDELETEALL | diff --git a/sys/nfs/nfssvc.h b/sys/nfs/nfssvc.h index 4b51f7b02719..61ed1a3e7a43 100644 --- a/sys/nfs/nfssvc.h +++ b/sys/nfs/nfssvc.h @@ -70,6 +70,7 @@ #define NFSSVC_RESUMENFSD 0x08000000 #define NFSSVC_DUMPMNTOPTS 0x10000000 #define NFSSVC_NEWSTRUCT 0x20000000 +#define NFSSVC_FORCEDISM 0x40000000 /* Argument structure for NFSSVC_DUMPMNTOPTS. */ struct nfscl_dumpmntopts { |