aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jfs/namei.c
diff options
context:
space:
mode:
authorDave Kleikamp <shaggy@austin.ibm.com>2005-09-01 10:05:39 -0400
committerDave Kleikamp <shaggy@austin.ibm.com>2005-09-01 10:05:39 -0400
commit1d15b10f95d4c4295a0f2288c7be7b6a005490da (patch)
tree7fe1dccc9e6676d7d83421fc42ea9d1a9e16318c /fs/jfs/namei.c
parent4f4b401bfaa97edbea41a1fcab794148e7ac0421 (diff)
JFS: Implement jfs_init_security
This atomically initializes the security xattr when an object is created Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
Diffstat (limited to 'fs/jfs/namei.c')
-rw-r--r--fs/jfs/namei.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
index f23f9c2aa525..1abe7343f920 100644
--- a/fs/jfs/namei.c
+++ b/fs/jfs/namei.c
@@ -111,6 +111,12 @@ static int jfs_create(struct inode *dip, struct dentry *dentry, int mode,
111 if (rc) 111 if (rc)
112 goto out3; 112 goto out3;
113 113
114 rc = jfs_init_security(tid, ip, dip);
115 if (rc) {
116 txAbort(tid, 0);
117 goto out3;
118 }
119
114 if ((rc = dtSearch(dip, &dname, &ino, &btstack, JFS_CREATE))) { 120 if ((rc = dtSearch(dip, &dname, &ino, &btstack, JFS_CREATE))) {
115 jfs_err("jfs_create: dtSearch returned %d", rc); 121 jfs_err("jfs_create: dtSearch returned %d", rc);
116 txAbort(tid, 0); 122 txAbort(tid, 0);
@@ -239,6 +245,12 @@ static int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode)
239 if (rc) 245 if (rc)
240 goto out3; 246 goto out3;
241 247
248 rc = jfs_init_security(tid, ip, dip);
249 if (rc) {
250 txAbort(tid, 0);
251 goto out3;
252 }
253
242 if ((rc = dtSearch(dip, &dname, &ino, &btstack, JFS_CREATE))) { 254 if ((rc = dtSearch(dip, &dname, &ino, &btstack, JFS_CREATE))) {
243 jfs_err("jfs_mkdir: dtSearch returned %d", rc); 255 jfs_err("jfs_mkdir: dtSearch returned %d", rc);
244 txAbort(tid, 0); 256 txAbort(tid, 0);
@@ -906,6 +918,10 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry,
906 down(&JFS_IP(dip)->commit_sem); 918 down(&JFS_IP(dip)->commit_sem);
907 down(&JFS_IP(ip)->commit_sem); 919 down(&JFS_IP(ip)->commit_sem);
908 920
921 rc = jfs_init_security(tid, ip, dip);
922 if (rc)
923 goto out3;
924
909 tblk = tid_to_tblock(tid); 925 tblk = tid_to_tblock(tid);
910 tblk->xflag |= COMMIT_CREATE; 926 tblk->xflag |= COMMIT_CREATE;
911 tblk->ino = ip->i_ino; 927 tblk->ino = ip->i_ino;
@@ -1349,6 +1365,12 @@ static int jfs_mknod(struct inode *dir, struct dentry *dentry,
1349 if (rc) 1365 if (rc)
1350 goto out3; 1366 goto out3;
1351 1367
1368 rc = jfs_init_security(tid, ip, dir);
1369 if (rc) {
1370 txAbort(tid, 0);
1371 goto out3;
1372 }
1373
1352 if ((rc = dtSearch(dir, &dname, &ino, &btstack, JFS_CREATE))) { 1374 if ((rc = dtSearch(dir, &dname, &ino, &btstack, JFS_CREATE))) {
1353 txAbort(tid, 0); 1375 txAbort(tid, 0);
1354 goto out3; 1376 goto out3;