From da5bf7cf104cd060b2f94d47132029689bfff685 Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Tue, 31 Aug 2010 06:50:37 +0000 Subject: nfs, mount3: Fix assumptions of this being child xl This is plain wrong. this must always be the xlator that receives the callback. Use cookie to access the child subvolume on which the fop was issued. Signed-off-by: Shehjar Tikoo Signed-off-by: Vijay Bellur BUG: 1410 (nfs uses this for child translator during frame creation) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1410 --- xlators/nfs/server/src/mount3.c | 13 ++++++++----- xlators/nfs/server/src/nfs.c | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'xlators/nfs') diff --git a/xlators/nfs/server/src/mount3.c b/xlators/nfs/server/src/mount3.c index ca94b25b705..2a7a36c8f7e 100644 --- a/xlators/nfs/server/src/mount3.c +++ b/xlators/nfs/server/src/mount3.c @@ -225,12 +225,14 @@ mnt3svc_lookup_mount_cbk (call_frame_t *frame, void *cookie, int autharr[10]; int autharrlen = 0; rpcsvc_t *svc = NULL; + xlator_t *mntxl = NULL; req = (rpcsvc_request_t *)frame->local; if (!req) return -1; + mntxl = (xlator_t *)cookie; ms = (struct mount3_state *)nfs_rpcsvc_request_program_private (req); if (!ms) { gf_log (GF_MNT, GF_LOG_ERROR, "mount state not found"); @@ -244,13 +246,13 @@ mnt3svc_lookup_mount_cbk (call_frame_t *frame, void *cookie, if (status != MNT3_OK) goto xmit_res; - fh = nfs3_fh_build_root_fh (ms->nfsx->children, this); - mnt3svc_update_mountlist (ms, req, this->name); + fh = nfs3_fh_build_root_fh (ms->nfsx->children, mntxl); + mnt3svc_update_mountlist (ms, req, mntxl->name); xmit_res: gf_log (GF_MNT, GF_LOG_DEBUG, "Mount reply status: %d", status); if (op_ret == 0) { svc = nfs_rpcsvc_request_service (req); - autharrlen = nfs_rpcsvc_auth_array (svc, this->name, autharr, + autharrlen = nfs_rpcsvc_auth_array (svc, mntxl->name, autharr, 10); } @@ -480,9 +482,10 @@ mnt3_resolve_subdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int autharrlen = 0; rpcsvc_t *svc = NULL; mountres3 res = {0, }; + xlator_t *mntxl = NULL; mres = frame->local; - + mntxl = (xlator_t *)cookie; if (op_ret == -1) { mntstat = mnt3svc_errno_to_mnterr (op_errno); goto err; @@ -509,7 +512,7 @@ err: gf_log (GF_MNT, GF_LOG_DEBUG, "Mount reply status: %d", mntstat); svc = nfs_rpcsvc_request_service (mres->req); - autharrlen = nfs_rpcsvc_auth_array (svc, this->name, autharr, + autharrlen = nfs_rpcsvc_auth_array (svc, mntxl->name, autharr, 10); res = mnt3svc_set_mountres3 (mntstat, &fh, autharr, autharrlen); diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c index 033a60ba2ad..8f3c8b2f520 100644 --- a/xlators/nfs/server/src/nfs.c +++ b/xlators/nfs/server/src/nfs.c @@ -233,7 +233,7 @@ nfs_start_subvol_lookup_cbk (call_frame_t *frame, void *cookie, goto err; } - gf_log (GF_NFS, GF_LOG_TRACE, "Started %s", this->name); + gf_log (GF_NFS, GF_LOG_TRACE, "Started %s", ((xlator_t *)cookie)->name); err: return 0; } -- cgit