From patchwork Mon Jun 21 22:20:26 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jvrao X-Patchwork-Id: 107271 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o5LMH7U5032762 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 21 Jun 2010 22:17:43 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1OQpIW-0006N9-9H; Mon, 21 Jun 2010 22:16:56 +0000 Received: from sfi-mx-2.v28.ch3.sourceforge.com ([172.29.28.122] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1OQpIV-0006My-Cn for v9fs-developer@lists.sourceforge.net; Mon, 21 Jun 2010 22:16:55 +0000 X-ACL-Warn: Received: from e31.co.us.ibm.com ([32.97.110.149]) by sfi-mx-2.v28.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1OQpIT-0007fJ-5E for v9fs-developer@lists.sourceforge.net; Mon, 21 Jun 2010 22:16:55 +0000 Received: from d03relay05.boulder.ibm.com (d03relay05.boulder.ibm.com [9.17.195.107]) by e31.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id o5LM644o005757 for ; Mon, 21 Jun 2010 16:06:04 -0600 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay05.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o5LMGiMk122308 for ; Mon, 21 Jun 2010 16:16:44 -0600 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 o5LMGiUr010009 for ; Mon, 21 Jun 2010 16:16:44 -0600 Received: from localhost.localdomain (elm9m80.beaverton.ibm.com [9.47.81.80]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id o5LMGhHC009925; Mon, 21 Jun 2010 16:16:43 -0600 From: "Venkateswararao Jujjuri (JV)" To: v9fs-developer@lists.sourceforge.net Date: Mon, 21 Jun 2010 15:20:26 -0700 Message-Id: <1277158826-21273-2-git-send-email-jvrao@linux.vnet.ibm.com> X-Mailer: git-send-email 1.6.0.6 In-Reply-To: <1277158826-21273-1-git-send-email-jvrao@linux.vnet.ibm.com> References: <1277158826-21273-1-git-send-email-jvrao@linux.vnet.ibm.com> X-Spam-Score: -0.4 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.4 AWL AWL: From: address is in the auto white-list X-Headers-End: 1OQpIT-0007fJ-5E Cc: linux-fsdevel@vger.kernel.org Subject: [V9fs-developer] [PATCH 2/2] [fs/9p] Check if the inode change is allowed. X-BeenThere: v9fs-developer@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: v9fs-developer-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 21 Jun 2010 22:17:43 +0000 (UTC) diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index a67f9f5..31a70c7 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c @@ -900,10 +900,19 @@ static int v9fs_vfs_setattr(struct dentry *dentry, struct iattr *iattr) struct v9fs_session_info *v9ses; struct p9_fid *fid; struct p9_wstat wstat; + int access; P9_DPRINTK(P9_DEBUG_VFS, "\n"); retval = -EPERM; v9ses = v9fs_inode2v9ses(dentry->d_inode); + access = v9ses->flags & V9FS_ACCESS_MASK; + + if ((access == V9FS_ACCESS_CLIENT)) { + retval = inode_change_ok(dentry->d_inode, iattr); + if (retval) + return retval; + } + fid = v9fs_fid_lookup(dentry); if(IS_ERR(fid)) return PTR_ERR(fid);