Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Jul 2018 19:46:26 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r335968 - head/sys/fs/nfsserver
Message-ID:  <201807041946.w64JkQu3001591@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Wed Jul  4 19:46:26 2018
New Revision: 335968
URL: https://svnweb.freebsd.org/changeset/base/335968

Log:
  Fix the pNFS server so that it handles the "#mds_path" check for mirrors.
  
  The recently added feature of the pNFS server will set an fsid for the
  MDS file system to define the file system a DS should store files for.
  For a case where a DS handling all file systems has failed, it was possible
  for the code to check for a mirror with a specified fs, even though
  nfsdev_mdsisset was 0, possibly causing a false successful check for a mirror.
  This patch adds a check for nfsdev_mdsisset != 0 to avoid this.
  It only affects the pNFS server for a rare case. Found via code inspection.

Modified:
  head/sys/fs/nfsserver/nfs_nfsdstate.c

Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdstate.c	Wed Jul  4 19:29:06 2018	(r335967)
+++ head/sys/fs/nfsserver/nfs_nfsdstate.c	Wed Jul  4 19:46:26 2018	(r335968)
@@ -7597,7 +7597,7 @@ nfsrv_delds(char *devid, NFSPROC_T *p)
 	}
 	if (fndds->nfsdev_mdsisset == 0 && nfsrv_faildscnt > 0)
 		fndmirror = 1;
-	else {
+	else if (fndds->nfsdev_mdsisset != 0) {
 		/* For the fsid is set case, search for a mirror. */
 		TAILQ_FOREACH(ds, &nfsrv_devidhead, nfsdev_list) {
 			if (ds != fndds && ds->nfsdev_nmp != NULL &&
@@ -8463,7 +8463,7 @@ nfsrv_findmirroredds(struct nfsmount *nmp)
 		return (fndds);
 	if (fndds->nfsdev_mdsisset == 0 && nfsrv_faildscnt > 0)
 		fndmirror = 1;
-	else {
+	else if (fndds->nfsdev_mdsisset != 0) {
 		/* For the fsid is set case, search for a mirror. */
 		TAILQ_FOREACH(ds, &nfsrv_devidhead, nfsdev_list) {
 			if (ds != fndds && ds->nfsdev_nmp != NULL &&



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807041946.w64JkQu3001591>