|
|
3604df |
From 5142508ada067c57df58fbf89074cce099e012b1 Mon Sep 17 00:00:00 2001
|
|
|
3604df |
From: Soumya Koduri <skoduri@redhat.com>
|
|
|
3604df |
Date: Wed, 17 May 2017 14:58:08 +0530
|
|
|
3604df |
Subject: [PATCH 316/316] Revert "nfs: make subdir mounting work for Solaris 10
|
|
|
3604df |
clients"
|
|
|
3604df |
|
|
|
3604df |
This reverts commit f25b41d227c2e58ebff356e73c7a5123dc032fb8.
|
|
|
3604df |
|
|
|
3604df |
There are others issues uncovered while qualifing this fix for
|
|
|
3604df |
3.2.0-async release. All the stake holders agreed to revert this
|
|
|
3604df |
change for now and address them in RHGS 3.3.0
|
|
|
3604df |
|
|
|
3604df |
BUG: 1451673
|
|
|
3604df |
Change-Id: Iae975b0a524eed80be19213ce448543e7073ad28
|
|
|
3604df |
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
|
|
|
3604df |
Reviewed-on: https://code.engineering.redhat.com/gerrit/106413
|
|
|
3604df |
Reviewed-by: Niels de Vos <ndevos@redhat.com>
|
|
|
3604df |
Reviewed-by: Jiffin Thottan <jthottan@redhat.com>
|
|
|
3604df |
Tested-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
3604df |
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
3604df |
---
|
|
|
3604df |
api/src/glfs-resolve.c | 6 +--
|
|
|
3604df |
xlators/nfs/server/src/nfs-common.c | 18 ++-----
|
|
|
3604df |
xlators/nfs/server/src/nfs3.c | 96 ++++++++++---------------------------
|
|
|
3604df |
3 files changed, 31 insertions(+), 89 deletions(-)
|
|
|
3604df |
|
|
|
3604df |
diff --git a/api/src/glfs-resolve.c b/api/src/glfs-resolve.c
|
|
|
3604df |
index d495cd2..f8b437b 100644
|
|
|
3604df |
--- a/api/src/glfs-resolve.c
|
|
|
3604df |
+++ b/api/src/glfs-resolve.c
|
|
|
3604df |
@@ -385,9 +385,6 @@ priv_glfs_resolve_at (struct glfs *fs, xlator_t *subvol, inode_t *at,
|
|
|
3604df |
int ret = -1;
|
|
|
3604df |
struct iatt ciatt = {0, };
|
|
|
3604df |
|
|
|
3604df |
- DECLARE_OLD_THIS;
|
|
|
3604df |
- __GLFS_ENTRY_VALIDATE_FS(fs, invalid_fs);
|
|
|
3604df |
-
|
|
|
3604df |
path = gf_strdup (origpath);
|
|
|
3604df |
if (!path) {
|
|
|
3604df |
errno = ENOMEM;
|
|
|
3604df |
@@ -513,10 +510,9 @@ priv_glfs_resolve_at (struct glfs *fs, xlator_t *subvol, inode_t *at,
|
|
|
3604df |
}
|
|
|
3604df |
out:
|
|
|
3604df |
GF_FREE (path);
|
|
|
3604df |
- __GLFS_EXIT_FS;
|
|
|
3604df |
|
|
|
3604df |
/* do NOT loc_wipe here as only last component might be missing */
|
|
|
3604df |
-invalid_fs:
|
|
|
3604df |
+
|
|
|
3604df |
return ret;
|
|
|
3604df |
}
|
|
|
3604df |
|
|
|
3604df |
diff --git a/xlators/nfs/server/src/nfs-common.c b/xlators/nfs/server/src/nfs-common.c
|
|
|
3604df |
index 5269188..af37f6b 100644
|
|
|
3604df |
--- a/xlators/nfs/server/src/nfs-common.c
|
|
|
3604df |
+++ b/xlators/nfs/server/src/nfs-common.c
|
|
|
3604df |
@@ -73,11 +73,10 @@ nfs_xlator_to_xlid (xlator_list_t *cl, xlator_t *xl)
|
|
|
3604df |
xlator_t *
|
|
|
3604df |
nfs_mntpath_to_xlator (xlator_list_t *cl, char *path)
|
|
|
3604df |
{
|
|
|
3604df |
- char *volname = NULL;
|
|
|
3604df |
- char *volptr = NULL;
|
|
|
3604df |
- size_t pathlen = -1;
|
|
|
3604df |
+ char *volname = NULL;
|
|
|
3604df |
+ char *volptr = NULL;
|
|
|
3604df |
+ size_t pathlen;
|
|
|
3604df |
xlator_t *targetxl = NULL;
|
|
|
3604df |
- int i = 0;
|
|
|
3604df |
|
|
|
3604df |
if ((!cl) || (!path))
|
|
|
3604df |
return NULL;
|
|
|
3604df |
@@ -90,17 +89,10 @@ nfs_mntpath_to_xlator (xlator_list_t *cl, char *path)
|
|
|
3604df |
else
|
|
|
3604df |
volptr = &volname[0];
|
|
|
3604df |
|
|
|
3604df |
- for (i = 0; i < pathlen; i++) {
|
|
|
3604df |
- if (volname[i] == '/') {
|
|
|
3604df |
- volname[i] = '\0';
|
|
|
3604df |
- break;
|
|
|
3604df |
- }
|
|
|
3604df |
- }
|
|
|
3604df |
+ if (pathlen && volname[pathlen - 1] == '/')
|
|
|
3604df |
+ volname[pathlen - 1] = '\0';
|
|
|
3604df |
|
|
|
3604df |
while (cl) {
|
|
|
3604df |
- gf_msg_trace (GF_NFS, 0, "Volptr: %s and cl->xlator->name: %s",
|
|
|
3604df |
- volptr, cl->xlator->name);
|
|
|
3604df |
-
|
|
|
3604df |
if (strcmp (volptr, cl->xlator->name) == 0) {
|
|
|
3604df |
targetxl = cl->xlator;
|
|
|
3604df |
break;
|
|
|
3604df |
diff --git a/xlators/nfs/server/src/nfs3.c b/xlators/nfs/server/src/nfs3.c
|
|
|
3604df |
index 8b1d62b..d6c9495 100644
|
|
|
3604df |
--- a/xlators/nfs/server/src/nfs3.c
|
|
|
3604df |
+++ b/xlators/nfs/server/src/nfs3.c
|
|
|
3604df |
@@ -28,7 +28,6 @@
|
|
|
3604df |
#include "xdr-rpc.h"
|
|
|
3604df |
#include "xdr-generic.h"
|
|
|
3604df |
#include "nfs-messages.h"
|
|
|
3604df |
-#include "glfs-internal.h"
|
|
|
3604df |
|
|
|
3604df |
#include <sys/socket.h>
|
|
|
3604df |
#include <sys/uio.h>
|
|
|
3604df |
@@ -349,68 +348,28 @@ out:
|
|
|
3604df |
}
|
|
|
3604df |
|
|
|
3604df |
|
|
|
3604df |
-static enum nfsstat3
|
|
|
3604df |
-nfs3_funge_webnfs_zerolen_fh (struct nfs3_state *nfs3st, struct nfs3_fh *fhd,
|
|
|
3604df |
- char *name)
|
|
|
3604df |
-{
|
|
|
3604df |
- xlator_t *fungexl = NULL;
|
|
|
3604df |
- glfs_t *fs = NULL;
|
|
|
3604df |
- loc_t loc = { 0, };
|
|
|
3604df |
- enum nfsstat3 nfsstat = NFS3ERR_SERVERFAULT;
|
|
|
3604df |
- int ret = -1;
|
|
|
3604df |
- size_t namelen = -1;
|
|
|
3604df |
-
|
|
|
3604df |
- fungexl = nfs_mntpath_to_xlator (nfs3st->exportslist, name);
|
|
|
3604df |
- if (!fungexl) {
|
|
|
3604df |
- nfsstat = NFS3ERR_NOENT;
|
|
|
3604df |
- goto out;
|
|
|
3604df |
- }
|
|
|
3604df |
-
|
|
|
3604df |
- /* glfs_resolve_at copied from UDP MNT support */
|
|
|
3604df |
- fs = glfs_new_from_ctx (fungexl->ctx);
|
|
|
3604df |
- if (!fs) {
|
|
|
3604df |
- nfsstat = NFS3ERR_NOENT;
|
|
|
3604df |
- goto out;
|
|
|
3604df |
- }
|
|
|
3604df |
-
|
|
|
3604df |
- /* strip volname/ from 'name' */
|
|
|
3604df |
- namelen = strlen(name);
|
|
|
3604df |
- while (namelen != 0) {
|
|
|
3604df |
- name++;
|
|
|
3604df |
- if (name[0] == '/') {
|
|
|
3604df |
- break;
|
|
|
3604df |
- }
|
|
|
3604df |
- namelen--;
|
|
|
3604df |
- }
|
|
|
3604df |
- gf_msg_debug (GF_NFS, 0, "NAME :%s ", name);
|
|
|
3604df |
-
|
|
|
3604df |
- ret = glfs_resolve_at (fs, fungexl, NULL, name, &loc, NULL, 1, 0);
|
|
|
3604df |
- if (ret != 0) {
|
|
|
3604df |
- nfsstat = NFS3ERR_NOENT;
|
|
|
3604df |
- goto out;
|
|
|
3604df |
- }
|
|
|
3604df |
-
|
|
|
3604df |
- /* resolved subdir, copy gfid for the fh */
|
|
|
3604df |
- gf_uuid_copy (fhd->gfid, loc.gfid);
|
|
|
3604df |
- loc_wipe (&loc;;
|
|
|
3604df |
-
|
|
|
3604df |
- if (gf_nfs_dvm_off (nfs_state (nfs3st->nfsx)))
|
|
|
3604df |
- fhd->exportid[15] = nfs_xlator_to_xlid (nfs3st->exportslist,
|
|
|
3604df |
- fungexl);
|
|
|
3604df |
- else {
|
|
|
3604df |
- if (__nfs3_get_volume_id (nfs3st, fungexl, fhd->exportid) < 0) {
|
|
|
3604df |
- nfsstat = NFS3ERR_STALE;
|
|
|
3604df |
- goto out;
|
|
|
3604df |
- }
|
|
|
3604df |
- }
|
|
|
3604df |
-
|
|
|
3604df |
- nfsstat = NFS3_OK;
|
|
|
3604df |
-out:
|
|
|
3604df |
- if (fs)
|
|
|
3604df |
- glfs_free_from_ctx (fs);
|
|
|
3604df |
-
|
|
|
3604df |
- return nfsstat;
|
|
|
3604df |
-}
|
|
|
3604df |
+#define nfs3_funge_solaris_zerolen_fh(nfs3st, fhd, enam, nfsst, erl) \
|
|
|
3604df |
+ do { \
|
|
|
3604df |
+ xlator_t *fungexl = NULL; \
|
|
|
3604df |
+ uuid_t zero = {0, }; \
|
|
|
3604df |
+ fungexl = nfs_mntpath_to_xlator ((nfs3st)->exportslist, enam);\
|
|
|
3604df |
+ if (!fungexl) { \
|
|
|
3604df |
+ (nfsst) = NFS3ERR_NOENT; \
|
|
|
3604df |
+ goto erl; \
|
|
|
3604df |
+ } \
|
|
|
3604df |
+ \
|
|
|
3604df |
+ gf_uuid_copy ((fhd)->gfid, zero); \
|
|
|
3604df |
+ (fhd)->gfid[15] = 1; \
|
|
|
3604df |
+ (enam) = NULL; \
|
|
|
3604df |
+ if ((gf_nfs_dvm_off (nfs_state (nfs3st->nfsx)))) \
|
|
|
3604df |
+ (fhd)->exportid[15] = nfs_xlator_to_xlid ((nfs3st)->exportslist, fungexl); \
|
|
|
3604df |
+ else { \
|
|
|
3604df |
+ if (__nfs3_get_volume_id ((nfs3st), fungexl, (fhd)->exportid) < 0) { \
|
|
|
3604df |
+ (nfsst) = NFS3ERR_STALE; \
|
|
|
3604df |
+ goto erl; \
|
|
|
3604df |
+ } \
|
|
|
3604df |
+ } \
|
|
|
3604df |
+ } while (0) \
|
|
|
3604df |
|
|
|
3604df |
|
|
|
3604df |
#define nfs3_volume_started_check(nf3stt, vlm, rtval, erlbl) \
|
|
|
3604df |
@@ -1536,14 +1495,9 @@ nfs3_lookup (rpcsvc_request_t *req, struct nfs3_fh *fh, int fhlen, char *name)
|
|
|
3604df |
nfs3_log_fh_entry_call (rpcsvc_request_xid (req), "LOOKUP", fh,
|
|
|
3604df |
name);
|
|
|
3604df |
nfs3_validate_nfs3_state (req, nfs3, stat, nfs3err, ret);
|
|
|
3604df |
- if (nfs3_solaris_zerolen_fh (fh, fhlen)) {
|
|
|
3604df |
- stat = nfs3_funge_webnfs_zerolen_fh (nfs3, fh, name);
|
|
|
3604df |
- if (stat != NFS3_OK)
|
|
|
3604df |
- goto nfs3err;
|
|
|
3604df |
-
|
|
|
3604df |
- /* this fh means we're doing a mount, name is no more useful */
|
|
|
3604df |
- name = NULL;
|
|
|
3604df |
- } else
|
|
|
3604df |
+ if (nfs3_solaris_zerolen_fh (fh, fhlen))
|
|
|
3604df |
+ nfs3_funge_solaris_zerolen_fh (nfs3, fh, name, stat, nfs3err);
|
|
|
3604df |
+ else
|
|
|
3604df |
nfs3_validate_gluster_fh (fh, stat, nfs3err);
|
|
|
3604df |
nfs3_validate_strlen_or_goto (name, NFS_NAME_MAX, nfs3err, stat, ret);
|
|
|
3604df |
nfs3_map_fh_to_volume (nfs3, fh, req, vol, stat, nfs3err);
|
|
|
3604df |
--
|
|
|
3604df |
1.8.3.1
|
|
|
3604df |
|