From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Van Hensbergen Subject: Re: [V9fs-developer] [PATCH 3/3] 9p: add 9P2000.L unlinkat operation Date: Tue, 14 Jun 2011 10:14:55 -0500 Message-ID: References: <1307383308-5773-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <1307383308-5773-3-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <87oc20ew5b.fsf@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: v9fs-developer@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: "Aneesh Kumar K.V" Return-path: Received: from mail-ey0-f174.google.com ([209.85.215.174]:48007 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751484Ab1FNPQZ convert rfc822-to-8bit (ORCPT ); Tue, 14 Jun 2011 11:16:25 -0400 In-Reply-To: <87oc20ew5b.fsf@linux.vnet.ibm.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, Jun 14, 2011 at 1:59 AM, Aneesh Kumar K.V wrote: > On Mon, 13 Jun 2011 16:12:52 -0500, Eric Van Hensbergen wrote: >> Could be wrong, but a quick regression check of your patches fails >> against a legacy server. =A0Are you making sure the new operations a= re >> properly protected by a .L flag? > > How about below diff > > [3.0-pending@v9fs]$ git diff > diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c > index f40fdc3..436699e 100644 > --- a/fs/9p/vfs_inode.c > +++ b/fs/9p/vfs_inode.c > @@ -499,13 +499,15 @@ v9fs_inode_from_fid(struct v9fs_session_info *v= 9ses, struct p9_fid *fid, > > =A0static int v9fs_remove(struct inode *dir, struct dentry *dentry, i= nt flags) > =A0{ > - =A0 =A0 =A0 int retval; > =A0 =A0 =A0 =A0struct inode *inode; > + =A0 =A0 =A0 int retval =3D -EOPNOTSUPP; > =A0 =A0 =A0 =A0struct p9_fid *v9fid, *dfid; > + =A0 =A0 =A0 struct v9fs_session_info *v9ses; > > =A0 =A0 =A0 =A0P9_DPRINTK(P9_DEBUG_VFS, "inode: %p dentry: %p rmdir: = %x\n", > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dir, dentry, flags); > > + =A0 =A0 =A0 v9ses =3D v9fs_inode2v9ses(dir); > =A0 =A0 =A0 =A0inode =3D dentry->d_inode; > =A0 =A0 =A0 =A0dfid =3D v9fs_fid_lookup(dentry->d_parent); > =A0 =A0 =A0 =A0if (IS_ERR(dfid)) { > @@ -513,7 +515,8 @@ static int v9fs_remove(struct inode *dir, struct = dentry *dentry, int flags) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0P9_DPRINTK(P9_DEBUG_VFS, "fid lookup f= ailed %d\n", retval); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return retval; > =A0 =A0 =A0 =A0} > - =A0 =A0 =A0 retval =3D p9_client_unlinkat(dfid, dentry->d_name.name= , flags); > + =A0 =A0 =A0 if (v9fs_proto_dotl(v9ses)) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 retval =3D p9_client_unlinkat(dfid, den= try->d_name.name, flags); > =A0 =A0 =A0 =A0if (retval =3D=3D -EOPNOTSUPP) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* Try the one based on path */ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0v9fid =3D v9fs_fid_clone(dentry); > Looks right. > > related to renameat i have updated to check for -EOPNOTSUPP instead o= f > -ENOSYS. I am not sure any other dotl server out there is returning > -ENOSYS. We haven't documented what the server should return in case = it > doesn't support any specific operation. > Yeah, the real tricky thing is I'm not sure what the other 9p servers will send back since there are so many of them. I guess for dotl all we need to do is look at diod and see what they are returning (however, I'm sure they'll change if we want to make EOPNOTSUPP standard). -eric -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html