diff options
Diffstat (limited to 'fs/9p/acl.c')
-rw-r--r-- | fs/9p/acl.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/fs/9p/acl.c b/fs/9p/acl.c index d7211e28c0d1..075bc909da17 100644 --- a/fs/9p/acl.c +++ b/fs/9p/acl.c | |||
@@ -206,30 +206,18 @@ int v9fs_acl_mode(struct inode *dir, mode_t *modep, | |||
206 | mode &= ~current_umask(); | 206 | mode &= ~current_umask(); |
207 | } | 207 | } |
208 | if (acl) { | 208 | if (acl) { |
209 | struct posix_acl *clone; | ||
210 | |||
211 | if (S_ISDIR(mode)) | 209 | if (S_ISDIR(mode)) |
212 | *dpacl = posix_acl_dup(acl); | 210 | *dpacl = posix_acl_dup(acl); |
213 | clone = posix_acl_clone(acl, GFP_NOFS); | 211 | retval = posix_acl_create(&acl, GFP_NOFS, &mode); |
214 | posix_acl_release(acl); | 212 | if (retval < 0) |
215 | if (!clone) | 213 | return retval; |
216 | return -ENOMEM; | ||
217 | |||
218 | retval = posix_acl_create_masq(clone, &mode); | ||
219 | if (retval < 0) { | ||
220 | posix_acl_release(clone); | ||
221 | goto cleanup; | ||
222 | } | ||
223 | if (retval > 0) | 214 | if (retval > 0) |
224 | *pacl = clone; | 215 | *pacl = acl; |
225 | else | 216 | else |
226 | posix_acl_release(clone); | 217 | posix_acl_release(acl); |
227 | } | 218 | } |
228 | *modep = mode; | 219 | *modep = mode; |
229 | return 0; | 220 | return 0; |
230 | cleanup: | ||
231 | return retval; | ||
232 | |||
233 | } | 221 | } |
234 | 222 | ||
235 | static int v9fs_remote_get_acl(struct dentry *dentry, const char *name, | 223 | static int v9fs_remote_get_acl(struct dentry *dentry, const char *name, |