diff options
author | Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com> | 2011-01-13 19:33:00 -0500 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2011-03-15 10:57:33 -0400 |
commit | d344b0fb72e00339625464c5a29711906fa70b8b (patch) | |
tree | a21de11ffefb46ae20be1d2f829547a6a4319b53 /fs/9p | |
parent | c61fa0d6d9d466356ffa89fa1c1a9a1cd726fab4 (diff) |
[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 <jvrao@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Diffstat (limited to 'fs/9p')
-rw-r--r-- | fs/9p/acl.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/9p/acl.c b/fs/9p/acl.c index 291ff7be27f6..0a2e480477a5 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) | |||
132 | struct inode *inode = dentry->d_inode; | 132 | struct inode *inode = dentry->d_inode; |
133 | 133 | ||
134 | set_cached_acl(inode, type, acl); | 134 | set_cached_acl(inode, type, acl); |
135 | |||
136 | if (!acl) | ||
137 | return 0; | ||
138 | |||
135 | /* Set a setxattr request to server */ | 139 | /* Set a setxattr request to server */ |
136 | size = posix_acl_xattr_size(acl->a_count); | 140 | size = posix_acl_xattr_size(acl->a_count); |
137 | buffer = kmalloc(size, GFP_KERNEL); | 141 | buffer = kmalloc(size, GFP_KERNEL); |
@@ -181,10 +185,8 @@ int v9fs_acl_chmod(struct dentry *dentry) | |||
181 | int v9fs_set_create_acl(struct dentry *dentry, | 185 | int v9fs_set_create_acl(struct dentry *dentry, |
182 | struct posix_acl *dpacl, struct posix_acl *pacl) | 186 | struct posix_acl *dpacl, struct posix_acl *pacl) |
183 | { | 187 | { |
184 | if (dpacl) | 188 | v9fs_set_acl(dentry, ACL_TYPE_DEFAULT, dpacl); |
185 | v9fs_set_acl(dentry, ACL_TYPE_DEFAULT, dpacl); | 189 | v9fs_set_acl(dentry, ACL_TYPE_ACCESS, pacl); |
186 | if (pacl) | ||
187 | v9fs_set_acl(dentry, ACL_TYPE_ACCESS, pacl); | ||
188 | posix_acl_release(dpacl); | 190 | posix_acl_release(dpacl); |
189 | posix_acl_release(pacl); | 191 | posix_acl_release(pacl); |
190 | return 0; | 192 | return 0; |