blob: a6ce532402dc7ec9851e18fe572c3ad1faf14a2a [file] [log] [blame]
Randy Dunlap16f7e0f2006-01-11 12:17:46 -08001#include <linux/capability.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#include <linux/fs.h>
3#include <linux/posix_acl.h>
Al Virof466c6f2012-03-17 01:16:43 -04004#include "reiserfs.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -07005#include <linux/errno.h>
6#include <linux/pagemap.h>
7#include <linux/xattr.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +09008#include <linux/slab.h>
Christoph Hellwig9a59f452005-06-23 00:10:19 -07009#include <linux/posix_acl_xattr.h>
Al Viroc45ac882012-03-17 00:59:06 -040010#include "xattr.h"
Al Viroa3063ab2012-03-17 01:03:10 -040011#include "acl.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070012#include <asm/uaccess.h>
13
Christoph Hellwig47f70d02013-12-20 05:16:49 -080014static int __reiserfs_set_acl(struct reiserfs_transaction_handle *th,
Jeff Mahoney0ab26212009-03-30 14:02:39 -040015 struct inode *inode, int type,
Linus Torvaldsbd4c6252005-07-12 20:21:28 -070016 struct posix_acl *acl);
Linus Torvalds1da177e2005-04-16 15:20:36 -070017
Christoph Hellwig47f70d02013-12-20 05:16:49 -080018
19int
20reiserfs_set_acl(struct inode *inode, struct posix_acl *acl, int type)
Linus Torvalds1da177e2005-04-16 15:20:36 -070021{
Jeff Mahoney0ab26212009-03-30 14:02:39 -040022 int error, error2;
23 struct reiserfs_transaction_handle th;
24 size_t jcreate_blocks;
Christoph Hellwig47f70d02013-12-20 05:16:49 -080025 int size = acl ? posix_acl_xattr_size(acl->a_count) : 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -070026
Linus Torvalds1da177e2005-04-16 15:20:36 -070027
Jeff Mahoney0ab26212009-03-30 14:02:39 -040028 /* Pessimism: We can't assume that anything from the xattr root up
29 * has been created. */
30
31 jcreate_blocks = reiserfs_xattr_jcreate_nblocks(inode) +
32 reiserfs_xattr_nblocks(inode, size) * 2;
33
34 reiserfs_write_lock(inode->i_sb);
35 error = journal_begin(&th, inode->i_sb, jcreate_blocks);
Jeff Mahoney4c051412013-08-08 17:27:19 -040036 reiserfs_write_unlock(inode->i_sb);
Jeff Mahoney0ab26212009-03-30 14:02:39 -040037 if (error == 0) {
Christoph Hellwig47f70d02013-12-20 05:16:49 -080038 error = __reiserfs_set_acl(&th, inode, type, acl);
Jeff Mahoney4c051412013-08-08 17:27:19 -040039 reiserfs_write_lock(inode->i_sb);
Jeff Mahoney0ab26212009-03-30 14:02:39 -040040 error2 = journal_end(&th, inode->i_sb, jcreate_blocks);
Jeff Mahoney4c051412013-08-08 17:27:19 -040041 reiserfs_write_unlock(inode->i_sb);
Jeff Mahoney0ab26212009-03-30 14:02:39 -040042 if (error2)
43 error = error2;
44 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070045
Linus Torvalds1da177e2005-04-16 15:20:36 -070046 return error;
47}
48
Linus Torvalds1da177e2005-04-16 15:20:36 -070049/*
50 * Convert from filesystem to in-memory representation.
51 */
Christoph Hellwig9dad9432013-12-20 05:16:36 -080052static struct posix_acl *reiserfs_posix_acl_from_disk(const void *value, size_t size)
Linus Torvalds1da177e2005-04-16 15:20:36 -070053{
54 const char *end = (char *)value + size;
55 int n, count;
56 struct posix_acl *acl;
57
58 if (!value)
59 return NULL;
60 if (size < sizeof(reiserfs_acl_header))
Linus Torvaldsbd4c6252005-07-12 20:21:28 -070061 return ERR_PTR(-EINVAL);
62 if (((reiserfs_acl_header *) value)->a_version !=
Linus Torvalds1da177e2005-04-16 15:20:36 -070063 cpu_to_le32(REISERFS_ACL_VERSION))
64 return ERR_PTR(-EINVAL);
65 value = (char *)value + sizeof(reiserfs_acl_header);
66 count = reiserfs_acl_count(size);
67 if (count < 0)
68 return ERR_PTR(-EINVAL);
69 if (count == 0)
70 return NULL;
71 acl = posix_acl_alloc(count, GFP_NOFS);
72 if (!acl)
73 return ERR_PTR(-ENOMEM);
Linus Torvaldsbd4c6252005-07-12 20:21:28 -070074 for (n = 0; n < count; n++) {
75 reiserfs_acl_entry *entry = (reiserfs_acl_entry *) value;
Linus Torvalds1da177e2005-04-16 15:20:36 -070076 if ((char *)value + sizeof(reiserfs_acl_entry_short) > end)
77 goto fail;
Linus Torvaldsbd4c6252005-07-12 20:21:28 -070078 acl->a_entries[n].e_tag = le16_to_cpu(entry->e_tag);
Linus Torvalds1da177e2005-04-16 15:20:36 -070079 acl->a_entries[n].e_perm = le16_to_cpu(entry->e_perm);
Linus Torvaldsbd4c6252005-07-12 20:21:28 -070080 switch (acl->a_entries[n].e_tag) {
81 case ACL_USER_OBJ:
82 case ACL_GROUP_OBJ:
83 case ACL_MASK:
84 case ACL_OTHER:
85 value = (char *)value +
86 sizeof(reiserfs_acl_entry_short);
Linus Torvaldsbd4c6252005-07-12 20:21:28 -070087 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -070088
Linus Torvaldsbd4c6252005-07-12 20:21:28 -070089 case ACL_USER:
Eric W. Biedermandf814652012-02-07 16:30:06 -080090 value = (char *)value + sizeof(reiserfs_acl_entry);
91 if ((char *)value > end)
92 goto fail;
93 acl->a_entries[n].e_uid =
94 make_kuid(&init_user_ns,
95 le32_to_cpu(entry->e_id));
96 break;
Linus Torvaldsbd4c6252005-07-12 20:21:28 -070097 case ACL_GROUP:
98 value = (char *)value + sizeof(reiserfs_acl_entry);
99 if ((char *)value > end)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100 goto fail;
Eric W. Biedermandf814652012-02-07 16:30:06 -0800101 acl->a_entries[n].e_gid =
102 make_kgid(&init_user_ns,
103 le32_to_cpu(entry->e_id));
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700104 break;
105
106 default:
107 goto fail;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108 }
109 }
110 if (value != end)
111 goto fail;
112 return acl;
113
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700114 fail:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700115 posix_acl_release(acl);
116 return ERR_PTR(-EINVAL);
117}
118
119/*
120 * Convert from in-memory to filesystem representation.
121 */
Christoph Hellwig9dad9432013-12-20 05:16:36 -0800122static void *reiserfs_posix_acl_to_disk(const struct posix_acl *acl, size_t * size)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700123{
124 reiserfs_acl_header *ext_acl;
125 char *e;
126 int n;
127
128 *size = reiserfs_acl_size(acl->a_count);
Robert P. J. Day5cbded52006-12-13 00:35:56 -0800129 ext_acl = kmalloc(sizeof(reiserfs_acl_header) +
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700130 acl->a_count *
131 sizeof(reiserfs_acl_entry),
132 GFP_NOFS);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700133 if (!ext_acl)
134 return ERR_PTR(-ENOMEM);
135 ext_acl->a_version = cpu_to_le32(REISERFS_ACL_VERSION);
136 e = (char *)ext_acl + sizeof(reiserfs_acl_header);
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700137 for (n = 0; n < acl->a_count; n++) {
Eric W. Biedermandf814652012-02-07 16:30:06 -0800138 const struct posix_acl_entry *acl_e = &acl->a_entries[n];
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700139 reiserfs_acl_entry *entry = (reiserfs_acl_entry *) e;
140 entry->e_tag = cpu_to_le16(acl->a_entries[n].e_tag);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700141 entry->e_perm = cpu_to_le16(acl->a_entries[n].e_perm);
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700142 switch (acl->a_entries[n].e_tag) {
143 case ACL_USER:
Eric W. Biedermandf814652012-02-07 16:30:06 -0800144 entry->e_id = cpu_to_le32(
145 from_kuid(&init_user_ns, acl_e->e_uid));
146 e += sizeof(reiserfs_acl_entry);
147 break;
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700148 case ACL_GROUP:
Eric W. Biedermandf814652012-02-07 16:30:06 -0800149 entry->e_id = cpu_to_le32(
150 from_kgid(&init_user_ns, acl_e->e_gid));
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700151 e += sizeof(reiserfs_acl_entry);
152 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700153
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700154 case ACL_USER_OBJ:
155 case ACL_GROUP_OBJ:
156 case ACL_MASK:
157 case ACL_OTHER:
158 e += sizeof(reiserfs_acl_entry_short);
159 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700160
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700161 default:
162 goto fail;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700163 }
164 }
165 return (char *)ext_acl;
166
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700167 fail:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700168 kfree(ext_acl);
169 return ERR_PTR(-EINVAL);
170}
171
172/*
173 * Inode operation get_posix_acl().
174 *
Jes Sorensen1b1dcc12006-01-09 15:59:24 -0800175 * inode->i_mutex: down
Linus Torvalds1da177e2005-04-16 15:20:36 -0700176 * BKL held [before 2.5.x]
177 */
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700178struct posix_acl *reiserfs_get_acl(struct inode *inode, int type)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700179{
180 char *name, *value;
Al Viro073aaa12009-06-09 12:11:54 -0400181 struct posix_acl *acl;
Adrian Bunk3cdc4092006-03-25 03:07:50 -0800182 int size;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700183 int retval;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700184
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700185 switch (type) {
186 case ACL_TYPE_ACCESS:
187 name = POSIX_ACL_XATTR_ACCESS;
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700188 break;
189 case ACL_TYPE_DEFAULT:
190 name = POSIX_ACL_XATTR_DEFAULT;
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700191 break;
192 default:
Al Viro073aaa12009-06-09 12:11:54 -0400193 BUG();
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700194 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700195
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700196 size = reiserfs_xattr_get(inode, name, NULL, 0);
Adrian Bunk3cdc4092006-03-25 03:07:50 -0800197 if (size < 0) {
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700198 if (size == -ENODATA || size == -ENOSYS) {
Al Viro073aaa12009-06-09 12:11:54 -0400199 set_cached_acl(inode, type, NULL);
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700200 return NULL;
201 }
202 return ERR_PTR(size);
203 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700204
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700205 value = kmalloc(size, GFP_NOFS);
206 if (!value)
207 return ERR_PTR(-ENOMEM);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700208
209 retval = reiserfs_xattr_get(inode, name, value, size);
210 if (retval == -ENODATA || retval == -ENOSYS) {
211 /* This shouldn't actually happen as it should have
212 been caught above.. but just in case */
213 acl = NULL;
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700214 } else if (retval < 0) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700215 acl = ERR_PTR(retval);
216 } else {
Christoph Hellwig9dad9432013-12-20 05:16:36 -0800217 acl = reiserfs_posix_acl_from_disk(value, retval);
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700218 }
Al Viro073aaa12009-06-09 12:11:54 -0400219 if (!IS_ERR(acl))
220 set_cached_acl(inode, type, acl);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700221
222 kfree(value);
223 return acl;
224}
225
226/*
227 * Inode operation set_posix_acl().
228 *
Jes Sorensen1b1dcc12006-01-09 15:59:24 -0800229 * inode->i_mutex: down
Linus Torvalds1da177e2005-04-16 15:20:36 -0700230 * BKL held [before 2.5.x]
231 */
232static int
Christoph Hellwig47f70d02013-12-20 05:16:49 -0800233__reiserfs_set_acl(struct reiserfs_transaction_handle *th, struct inode *inode,
Jeff Mahoney0ab26212009-03-30 14:02:39 -0400234 int type, struct posix_acl *acl)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700235{
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700236 char *name;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700237 void *value = NULL;
Jeff Mahoney48b32a32009-03-30 14:02:38 -0400238 size_t size = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700239 int error;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700240
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700241 switch (type) {
242 case ACL_TYPE_ACCESS:
243 name = POSIX_ACL_XATTR_ACCESS;
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700244 if (acl) {
Al Virod6952122011-07-23 18:56:36 -0400245 error = posix_acl_equiv_mode(acl, &inode->i_mode);
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700246 if (error < 0)
247 return error;
248 else {
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700249 if (error == 0)
250 acl = NULL;
251 }
252 }
253 break;
254 case ACL_TYPE_DEFAULT:
255 name = POSIX_ACL_XATTR_DEFAULT;
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700256 if (!S_ISDIR(inode->i_mode))
257 return acl ? -EACCES : 0;
258 break;
259 default:
260 return -EINVAL;
261 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700262
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700263 if (acl) {
Christoph Hellwig9dad9432013-12-20 05:16:36 -0800264 value = reiserfs_posix_acl_to_disk(acl, &size);
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700265 if (IS_ERR(value))
266 return (int)PTR_ERR(value);
Jeff Mahoney48b32a32009-03-30 14:02:38 -0400267 }
268
Jeff Mahoney0ab26212009-03-30 14:02:39 -0400269 error = reiserfs_xattr_set_handle(th, inode, name, value, size, 0);
Jeff Mahoney48b32a32009-03-30 14:02:38 -0400270
271 /*
272 * Ensure that the inode gets dirtied if we're only using
273 * the mode bits and an old ACL didn't exist. We don't need
274 * to check if the inode is hashed here since we won't get
275 * called by reiserfs_inherit_default_acl().
276 */
277 if (error == -ENODATA) {
278 error = 0;
279 if (type == ACL_TYPE_ACCESS) {
280 inode->i_ctime = CURRENT_TIME_SEC;
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700281 mark_inode_dirty(inode);
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700282 }
283 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700284
James Lamanna833d3042005-10-30 15:00:16 -0800285 kfree(value);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700286
Jeff Mahoneyd9845612009-03-30 14:02:35 -0400287 if (!error)
Al Viro073aaa12009-06-09 12:11:54 -0400288 set_cached_acl(inode, type, acl);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700289
290 return error;
291}
292
Jes Sorensen1b1dcc12006-01-09 15:59:24 -0800293/* dir->i_mutex: locked,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700294 * inode is new and not released into the wild yet */
295int
Jeff Mahoney0ab26212009-03-30 14:02:39 -0400296reiserfs_inherit_default_acl(struct reiserfs_transaction_handle *th,
297 struct inode *dir, struct dentry *dentry,
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700298 struct inode *inode)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700299{
Christoph Hellwig47f70d02013-12-20 05:16:49 -0800300 struct posix_acl *default_acl, *acl;
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700301 int err = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700302
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700303 /* ACLs only get applied to files and directories */
304 if (S_ISLNK(inode->i_mode))
305 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700306
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700307 /* ACLs can only be used on "new" objects, so if it's an old object
308 * there is nothing to inherit from */
309 if (get_inode_sd_version(dir) == STAT_DATA_V1)
310 goto apply_umask;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700311
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700312 /* Don't apply ACLs to objects in the .reiserfs_priv tree.. This
313 * would be useless since permissions are ignored, and a pain because
314 * it introduces locking cycles */
Jeff Mahoney6dfede692009-03-30 14:02:32 -0400315 if (IS_PRIVATE(dir)) {
316 inode->i_flags |= S_PRIVATE;
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700317 goto apply_umask;
318 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700319
Christoph Hellwig47f70d02013-12-20 05:16:49 -0800320 err = posix_acl_create(dir, &inode->i_mode, &default_acl, &acl);
321 if (err)
322 return err;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700323
Christoph Hellwig47f70d02013-12-20 05:16:49 -0800324 if (default_acl) {
325 err = __reiserfs_set_acl(th, inode, ACL_TYPE_DEFAULT,
326 default_acl);
327 posix_acl_release(default_acl);
328 }
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700329 if (acl) {
Christoph Hellwig47f70d02013-12-20 05:16:49 -0800330 if (!err)
331 err = __reiserfs_set_acl(th, inode, ACL_TYPE_ACCESS,
332 acl);
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700333 posix_acl_release(acl);
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700334 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700335
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700336 return err;
Christoph Hellwig47f70d02013-12-20 05:16:49 -0800337
338 apply_umask:
339 /* no ACL, apply umask */
340 inode->i_mode &= ~current_umask();
341 return err;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700342}
343
Jeff Mahoney0ab26212009-03-30 14:02:39 -0400344/* This is used to cache the default acl before a new object is created.
345 * The biggest reason for this is to get an idea of how many blocks will
346 * actually be required for the create operation if we must inherit an ACL.
347 * An ACL write can add up to 3 object creations and an additional file write
348 * so we'd prefer not to reserve that many blocks in the journal if we can.
349 * It also has the advantage of not loading the ACL with a transaction open,
350 * this may seem silly, but if the owner of the directory is doing the
351 * creation, the ACL may not be loaded since the permissions wouldn't require
352 * it.
353 * We return the number of blocks required for the transaction.
354 */
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700355int reiserfs_cache_default_acl(struct inode *inode)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700356{
Jeff Mahoney0ab26212009-03-30 14:02:39 -0400357 struct posix_acl *acl;
358 int nblocks = 0;
359
360 if (IS_PRIVATE(inode))
361 return 0;
362
363 acl = reiserfs_get_acl(inode, ACL_TYPE_DEFAULT);
364
365 if (acl && !IS_ERR(acl)) {
366 int size = reiserfs_acl_size(acl->a_count);
367
368 /* Other xattrs can be created during inode creation. We don't
369 * want to claim too many blocks, so we check to see if we
370 * we need to create the tree to the xattrs, and then we
371 * just want two files. */
372 nblocks = reiserfs_xattr_jcreate_nblocks(inode);
373 nblocks += JOURNAL_BLOCKS_PER_OBJECT(inode->i_sb);
374
375 REISERFS_I(inode)->i_flags |= i_has_xattr_dir;
376
377 /* We need to account for writes + bitmaps for two files */
378 nblocks += reiserfs_xattr_nblocks(inode, size) * 4;
379 posix_acl_release(acl);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700380 }
381
Jeff Mahoney0ab26212009-03-30 14:02:39 -0400382 return nblocks;
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700383}
384
Jeff Mahoney4c051412013-08-08 17:27:19 -0400385/*
386 * Called under i_mutex
387 */
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700388int reiserfs_acl_chmod(struct inode *inode)
389{
Jeff Mahoney4a857012013-05-31 15:54:17 -0400390 if (IS_PRIVATE(inode))
391 return 0;
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700392 if (get_inode_sd_version(inode) == STAT_DATA_V1 ||
Christoph Hellwig47f70d02013-12-20 05:16:49 -0800393 !reiserfs_posixacl(inode->i_sb))
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700394 return 0;
Linus Torvaldsbd4c6252005-07-12 20:21:28 -0700395
Christoph Hellwig47f70d02013-12-20 05:16:49 -0800396 return posix_acl_chmod(inode, inode->i_mode);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700397}