svn commit: r319960 - projects/pnfs-planb-server-stable11/sys/fs/nfsserver
Rick Macklem
rmacklem at FreeBSD.org
Thu Jun 15 00:26:28 UTC 2017
Author: rmacklem
Date: Thu Jun 15 00:26:27 2017
New Revision: 319960
URL: https://svnweb.freebsd.org/changeset/base/319960
Log:
Modify the handling of getattr for the DS attributes so that instead
of failing for the case where the pnfsd.dsattr extended attribute does not
exist, a Getattr RPC against the DS is attempted to (re)create this
extended attribute.
This allows a sysadmin to "rmextattr system pnfsd.dsattr <filename>" on
the MDS exported file system file, if these attributes somehow get messed up.
Modified:
projects/pnfs-planb-server-stable11/sys/fs/nfsserver/nfs_nfsdport.c
Modified: projects/pnfs-planb-server-stable11/sys/fs/nfsserver/nfs_nfsdport.c
==============================================================================
--- projects/pnfs-planb-server-stable11/sys/fs/nfsserver/nfs_nfsdport.c Wed Jun 14 20:34:02 2017 (r319959)
+++ projects/pnfs-planb-server-stable11/sys/fs/nfsserver/nfs_nfsdport.c Thu Jun 15 00:26:27 2017 (r319960)
@@ -3892,19 +3892,28 @@ nfsrv_proxyds(struct nfsrv_descript *nd, struct vnode
nap->na_size = dsattr.dsa_size;
nap->na_atime = dsattr.dsa_atime;
nap->na_mtime = dsattr.dsa_mtime;
+
+ /*
+ * If nfsrv_pnfsgetdsattr is 0 or nfsrv_checkdsattr()
+ * returns 0, just return now. nfsrv_checkdsattr()
+ * returns 0 if there is no Read/Write layout
+ * plus either an Open/Write_access or Write
+ * delegation issued to a client for the file.
+ */
+ if (nfsrv_pnfsgetdsattr == 0 ||
+ nfsrv_checkdsattr(nd, vp, p) == 0) {
+ free(buf, M_TEMP);
+ return (error);
+ }
}
/*
- * If nfsrv_pnfsgetdsattr is 0 or nfsrv_checkdsattr() returns
- * 0, just return now. nfsrv_checkdsattr() returns 0 if there
- * is no Read/Write layout + either an Open/Write_access or
- * Write delegation issued to a client for the file.
+ * Clear ENOATTR so the code below will attempt to do a
+ * nfsrv_getattrdsrpc() to get the attributes and (re)create
+ * the extended attribute.
*/
- if (nfsrv_pnfsgetdsattr == 0 || nfsrv_checkdsattr(nd, vp, p) ==
- 0) {
- free(buf, M_TEMP);
- return (error);
- }
+ if (error == ENOATTR)
+ error = 0;
}
if (error == 0) {
@@ -4422,7 +4431,6 @@ nfsrv_getattrdsrpc(fhandle_t *fhp, struct ucred *cred,
NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL,
NULL, NULL);
if (error == 0) {
- /* Do this as root so that it won't EACCES fail. */
error = nfsrv_setextattr(vp, nap, p);
NFSD_DEBUG(4, "nfsrv_getattrdsrpc: aft setextat=%d\n",
error);
More information about the svn-src-projects
mailing list