diff mbox

[V9fs-developer,RFC,2/2,fs/9p] Check if the inode change is allowed.

Message ID 1276042948-19257-2-git-send-email-jvrao@linux.vnet.ibm.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

jvrao June 9, 2010, 12:22 a.m. UTC
None
diff mbox

Patch

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);