diff mbox

[V9fs-developer,2/5,fs/9p] Initialze cached acls both in cached/uncached mode.

Message ID 1296004347-25254-1-git-send-email-jvrao@linux.vnet.ibm.com (mailing list archive)
State Changes Requested, archived
Delegated to: Eric Van Hensbergen
Headers show

Commit Message

jvrao Jan. 26, 2011, 1:12 a.m. UTC
None
diff mbox

Patch

diff --git a/fs/9p/acl.c b/fs/9p/acl.c
index 291ff7b..0a2e480 100644
--- a/fs/9p/acl.c
+++ b/fs/9p/acl.c
@@ -132,6 +132,10 @@  static int v9fs_set_acl(struct dentry *dentry, int type, struct posix_acl *acl)
 	struct inode *inode = dentry->d_inode;
 
 	set_cached_acl(inode, type, acl);
+
+	if (!acl)
+		return 0;
+
 	/* Set a setxattr request to server */
 	size = posix_acl_xattr_size(acl->a_count);
 	buffer = kmalloc(size, GFP_KERNEL);
@@ -181,10 +185,8 @@  int v9fs_acl_chmod(struct dentry *dentry)
 int v9fs_set_create_acl(struct dentry *dentry,
 			struct posix_acl *dpacl, struct posix_acl *pacl)
 {
-	if (dpacl)
-		v9fs_set_acl(dentry, ACL_TYPE_DEFAULT, dpacl);
-	if (pacl)
-		v9fs_set_acl(dentry, ACL_TYPE_ACCESS, pacl);
+	v9fs_set_acl(dentry, ACL_TYPE_DEFAULT, dpacl);
+	v9fs_set_acl(dentry, ACL_TYPE_ACCESS, pacl);
 	posix_acl_release(dpacl);
 	posix_acl_release(pacl);
 	return 0;