nfscl: Fix must_commit handling for mirrored pNFS mounts

For pNFS mounts to mirrored Flexible File layout pNFS servers,
the "must_commit" component in the nfsclwritedsdorpc
structure must be checked and the "must_commit" argument passed
into nfscl_doiods() must be updated.  Technically, only writes to
the DS with a writeverf change must be redone, but since this
occurrence will be rare, the must_commit argument to nfscl_doiosd()
is set to 1, so all writes to all DSs will be redone.

This bug would affect few, since use of mirrored pNFS servers
is rare and "writeverf" rarely changes. Normally "writeverf"
only changes when a NFS server reboots.

MFC after:	2 weeks
This commit is contained in:
Rick Macklem 2021-12-12 15:40:30 -08:00
parent 0b29683b32
commit 24947b701d

View file

@ -6253,6 +6253,10 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit,
timo);
if (error == 0 && tdrpc->err != 0)
error = tdrpc->err;
if (rwaccess != NFSV4OPEN_ACCESSREAD &&
docommit == 0 && *must_commit == 0 &&
tdrpc->must_commit == 1)
*must_commit = 1;
}
free(drpc, M_TEMP);
if (error == 0) {
@ -7001,8 +7005,8 @@ nfsio_writedsmir(vnode_t vp, int *iomode, int *must_commit,
NFSCL_DEBUG(4, "nfsio_writedsmir: nfs_pnfsio=%d\n", ret);
}
if (ret != 0)
error = nfsrpc_writedsmir(vp, iomode, must_commit, stateidp,
dsp, off, len, fhp, m, vers, minorvers, cred, p);
error = nfsrpc_writedsmir(vp, iomode, &drpc->must_commit,
stateidp, dsp, off, len, fhp, m, vers, minorvers, cred, p);
NFSCL_DEBUG(4, "nfsio_writedsmir: error=%d\n", error);
return (error);
}