From: Venkateswararao Jujjuri (JV) Date: Fri, 14 Jan 2011 00:33:00 +0000 (-0800) Subject: [fs/9p] Initialze cached acls both in cached/uncached mode. X-Git-Tag: v2.6.39-rc1~489^2~44 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=d344b0fb72e00339625464c5a29711906fa70b8b;p=~shefty%2Frdma-dev.git [fs/9p] Initialze cached acls both in cached/uncached mode. With create/mkdir/mknod in non cached mode we initialize the inode using v9fs_get_inode. v9fs_get_inode doesn't initialize the cache inode value to NULL. This is causing to trip on BUG_ON in v9fs_get_cached_acl. Fix is to initialize acls to NULL and not to leave them in ACL_NOT_CACHED state. Signed-off-by: Venkateswararao Jujjuri Signed-off-by: Eric Van Hensbergen Reviewed-by: Aneesh Kumar K.V --- diff --git a/fs/9p/acl.c b/fs/9p/acl.c index 291ff7be27f..0a2e480477a 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;