diff options
author | Tiger Yang <tiger.yang@oracle.com> | 2008-11-13 22:17:41 -0500 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2009-01-05 11:34:20 -0500 |
commit | 89c38bd0ade3c567707ed8fce088b253b0369c50 (patch) | |
tree | ffc5bf6a8871efa8e7793c552d16ac9fb92f1334 /fs/ocfs2/namei.c | |
parent | 060bc66dd5017460076d9e808e2198cd532c943d (diff) |
ocfs2: add ocfs2_init_acl in mknod
We need to get the parent directories acls and let the new child inherit it.
To this, we add additional calculations for data/metadata allocation.
Signed-off-by: Tiger Yang <tiger.yang@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/namei.c')
-rw-r--r-- | fs/ocfs2/namei.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index 40da46b907fb..765514512096 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c | |||
@@ -61,6 +61,7 @@ | |||
61 | #include "sysfile.h" | 61 | #include "sysfile.h" |
62 | #include "uptodate.h" | 62 | #include "uptodate.h" |
63 | #include "xattr.h" | 63 | #include "xattr.h" |
64 | #include "acl.h" | ||
64 | 65 | ||
65 | #include "buffer_head_io.h" | 66 | #include "buffer_head_io.h" |
66 | 67 | ||
@@ -302,14 +303,13 @@ static int ocfs2_mknod(struct inode *dir, | |||
302 | } | 303 | } |
303 | } | 304 | } |
304 | 305 | ||
305 | /* calculate meta data/clusters for setting security xattr */ | 306 | /* calculate meta data/clusters for setting security and acl xattr */ |
306 | if (si.enable) { | 307 | status = ocfs2_calc_xattr_init(dir, parent_fe_bh, mode, |
307 | status = ocfs2_calc_security_init(dir, &si, &want_clusters, | 308 | &si, &want_clusters, |
308 | &xattr_credits, &xattr_ac); | 309 | &xattr_credits, &xattr_ac); |
309 | if (status < 0) { | 310 | if (status < 0) { |
310 | mlog_errno(status); | 311 | mlog_errno(status); |
311 | goto leave; | 312 | goto leave; |
312 | } | ||
313 | } | 313 | } |
314 | 314 | ||
315 | /* Reserve a cluster if creating an extent based directory. */ | 315 | /* Reserve a cluster if creating an extent based directory. */ |
@@ -363,6 +363,13 @@ static int ocfs2_mknod(struct inode *dir, | |||
363 | inc_nlink(dir); | 363 | inc_nlink(dir); |
364 | } | 364 | } |
365 | 365 | ||
366 | status = ocfs2_init_acl(handle, inode, dir, new_fe_bh, parent_fe_bh, | ||
367 | xattr_ac, data_ac); | ||
368 | if (status < 0) { | ||
369 | mlog_errno(status); | ||
370 | goto leave; | ||
371 | } | ||
372 | |||
366 | if (si.enable) { | 373 | if (si.enable) { |
367 | status = ocfs2_init_security_set(handle, inode, new_fe_bh, &si, | 374 | status = ocfs2_init_security_set(handle, inode, new_fe_bh, &si, |
368 | xattr_ac, data_ac); | 375 | xattr_ac, data_ac); |