From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Venkateswararao Jujjuri (JV)" Subject: Re: [PATCH] [fs/9p] Make access=client default in 9p2000.L protocol Date: Thu, 27 Jan 2011 09:38:35 -0800 Message-ID: <4D41AD9B.6030102@linux.vnet.ibm.com> References: <1296111339-17414-1-git-send-email-jvrao@linux.vnet.ibm.com> <87oc72xvx8.fsf@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: v9fs-developer@lists.sourceforge.net, linux-fsdevel@vger.kernel.org To: "Aneesh Kumar K. V" Return-path: Received: from e32.co.us.ibm.com ([32.97.110.150]:54793 "EHLO e32.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751301Ab1A0Rii (ORCPT ); Thu, 27 Jan 2011 12:38:38 -0500 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e32.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id p0RHSUIh012705 for ; Thu, 27 Jan 2011 10:28:30 -0700 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p0RHcbQP095088 for ; Thu, 27 Jan 2011 10:38:37 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p0RHcaN4012316 for ; Thu, 27 Jan 2011 10:38:36 -0700 In-Reply-To: <87oc72xvx8.fsf@linux.vnet.ibm.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 1/27/2011 6:28 AM, Aneesh Kumar K. V wrote: > On Wed, 26 Jan 2011 22:55:39 -0800, "Venkateswararao Jujjuri (JV)" wrote: >> Current code sets access=user as default for all protocol versions. >> This patch chagnes it to "client" only for dotl. >> >> User can always specify particular access mode with -o access= option. >> No change there. >> >> Signed-off-by: Venkateswararao Jujjuri >> --- >> fs/9p/v9fs.c | 21 ++++++++++++--------- >> 1 files changed, 12 insertions(+), 9 deletions(-) >> >> diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c >> index 7823a7c..b9f6c34 100644 >> --- a/fs/9p/v9fs.c >> +++ b/fs/9p/v9fs.c >> @@ -263,19 +263,12 @@ struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses, >> list_add(&v9ses->slist, &v9fs_sessionlist); >> spin_unlock(&v9fs_sessionlist_lock); >> >> - v9ses->flags = V9FS_ACCESS_USER; >> strcpy(v9ses->uname, V9FS_DEFUSER); >> strcpy(v9ses->aname, V9FS_DEFANAME); >> v9ses->uid = ~0; >> v9ses->dfltuid = V9FS_DEFUID; >> v9ses->dfltgid = V9FS_DEFGID; >> >> - rc = v9fs_parse_options(v9ses, data); >> - if (rc < 0) { >> - retval = rc; >> - goto error; >> - } >> - > > Now we do v9fs option parsing after client_create ? is that ok ? Apparently yes. They parse the same buffer .. but no problem in switching May be we can run more testing..but it did not appear to be a problem. > >> v9ses->clnt = p9_client_create(dev_name, data); >> if (IS_ERR(v9ses->clnt)) { >> retval = PTR_ERR(v9ses->clnt); >> @@ -284,10 +277,20 @@ struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses, >> goto error; >> } >> >> - if (p9_is_proto_dotl(v9ses->clnt)) >> + v9ses->flags = V9FS_ACCESS_USER; >> + >> + if (p9_is_proto_dotl(v9ses->clnt)) { >> + v9ses->flags = V9FS_ACCESS_CLIENT; >> v9ses->flags |= V9FS_PROTO_2000L; >> - else if (p9_is_proto_dotu(v9ses->clnt)) >> + } else if (p9_is_proto_dotu(v9ses->clnt)) { >> v9ses->flags |= V9FS_PROTO_2000U; >> + } >> + >> + rc = v9fs_parse_options(v9ses, data); >> + if (rc < 0) { >> + retval = rc; >> + goto error; > > Don't we need a p9_client_destroy there ? No. v9fs_mount() will take care of this. v9fs_mount() calls session_init and session_close and those routines call client_create and client_destroy. - JV > >> + } >> >> v9ses->maxdata = v9ses->clnt->msize - P9_IOHDRSZ; >> > > -aneesh