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.
This commit is contained in:
Rick Macklem 2018-07-04 19:46:26 +00:00
parent 7eafc4d50b
commit ff3b992f38

View File

@ -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 &&