|
@@ -38,6 +38,24 @@ struct dentry_operations jfs_ci_dentry_operations;
|
|
|
|
|
|
static s64 commitZeroLink(tid_t, struct inode *);
|
|
static s64 commitZeroLink(tid_t, struct inode *);
|
|
|
|
|
|
|
|
+/*
|
|
|
|
+ * NAME: free_ea_wmap(inode)
|
|
|
|
+ *
|
|
|
|
+ * FUNCTION: free uncommitted extended attributes from working map
|
|
|
|
+ *
|
|
|
|
+ */
|
|
|
|
+static inline void free_ea_wmap(struct inode *inode)
|
|
|
|
+{
|
|
|
|
+ dxd_t *ea = &JFS_IP(inode)->ea;
|
|
|
|
+
|
|
|
|
+ if (ea->flag & DXD_EXTENT) {
|
|
|
|
+ /* free EA pages from cache */
|
|
|
|
+ invalidate_dxd_metapages(inode, *ea);
|
|
|
|
+ dbFree(inode, addressDXD(ea), lengthDXD(ea));
|
|
|
|
+ }
|
|
|
|
+ ea->flag = 0;
|
|
|
|
+}
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* NAME: jfs_create(dip, dentry, mode)
|
|
* NAME: jfs_create(dip, dentry, mode)
|
|
*
|
|
*
|
|
@@ -89,8 +107,13 @@ static int jfs_create(struct inode *dip, struct dentry *dentry, int mode,
|
|
down(&JFS_IP(dip)->commit_sem);
|
|
down(&JFS_IP(dip)->commit_sem);
|
|
down(&JFS_IP(ip)->commit_sem);
|
|
down(&JFS_IP(ip)->commit_sem);
|
|
|
|
|
|
|
|
+ rc = jfs_init_acl(tid, ip, dip);
|
|
|
|
+ if (rc)
|
|
|
|
+ goto out3;
|
|
|
|
+
|
|
if ((rc = dtSearch(dip, &dname, &ino, &btstack, JFS_CREATE))) {
|
|
if ((rc = dtSearch(dip, &dname, &ino, &btstack, JFS_CREATE))) {
|
|
jfs_err("jfs_create: dtSearch returned %d", rc);
|
|
jfs_err("jfs_create: dtSearch returned %d", rc);
|
|
|
|
+ txAbort(tid, 0);
|
|
goto out3;
|
|
goto out3;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -139,6 +162,7 @@ static int jfs_create(struct inode *dip, struct dentry *dentry, int mode,
|
|
up(&JFS_IP(dip)->commit_sem);
|
|
up(&JFS_IP(dip)->commit_sem);
|
|
up(&JFS_IP(ip)->commit_sem);
|
|
up(&JFS_IP(ip)->commit_sem);
|
|
if (rc) {
|
|
if (rc) {
|
|
|
|
+ free_ea_wmap(ip);
|
|
ip->i_nlink = 0;
|
|
ip->i_nlink = 0;
|
|
iput(ip);
|
|
iput(ip);
|
|
} else
|
|
} else
|
|
@@ -147,11 +171,6 @@ static int jfs_create(struct inode *dip, struct dentry *dentry, int mode,
|
|
out2:
|
|
out2:
|
|
free_UCSname(&dname);
|
|
free_UCSname(&dname);
|
|
|
|
|
|
-#ifdef CONFIG_JFS_POSIX_ACL
|
|
|
|
- if (rc == 0)
|
|
|
|
- jfs_init_acl(ip, dip);
|
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
out1:
|
|
out1:
|
|
|
|
|
|
jfs_info("jfs_create: rc:%d", rc);
|
|
jfs_info("jfs_create: rc:%d", rc);
|
|
@@ -216,8 +235,13 @@ static int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode)
|
|
down(&JFS_IP(dip)->commit_sem);
|
|
down(&JFS_IP(dip)->commit_sem);
|
|
down(&JFS_IP(ip)->commit_sem);
|
|
down(&JFS_IP(ip)->commit_sem);
|
|
|
|
|
|
|
|
+ rc = jfs_init_acl(tid, ip, dip);
|
|
|
|
+ if (rc)
|
|
|
|
+ goto out3;
|
|
|
|
+
|
|
if ((rc = dtSearch(dip, &dname, &ino, &btstack, JFS_CREATE))) {
|
|
if ((rc = dtSearch(dip, &dname, &ino, &btstack, JFS_CREATE))) {
|
|
jfs_err("jfs_mkdir: dtSearch returned %d", rc);
|
|
jfs_err("jfs_mkdir: dtSearch returned %d", rc);
|
|
|
|
+ txAbort(tid, 0);
|
|
goto out3;
|
|
goto out3;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -267,6 +291,7 @@ static int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode)
|
|
up(&JFS_IP(dip)->commit_sem);
|
|
up(&JFS_IP(dip)->commit_sem);
|
|
up(&JFS_IP(ip)->commit_sem);
|
|
up(&JFS_IP(ip)->commit_sem);
|
|
if (rc) {
|
|
if (rc) {
|
|
|
|
+ free_ea_wmap(ip);
|
|
ip->i_nlink = 0;
|
|
ip->i_nlink = 0;
|
|
iput(ip);
|
|
iput(ip);
|
|
} else
|
|
} else
|
|
@@ -275,10 +300,6 @@ static int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode)
|
|
out2:
|
|
out2:
|
|
free_UCSname(&dname);
|
|
free_UCSname(&dname);
|
|
|
|
|
|
-#ifdef CONFIG_JFS_POSIX_ACL
|
|
|
|
- if (rc == 0)
|
|
|
|
- jfs_init_acl(ip, dip);
|
|
|
|
-#endif
|
|
|
|
|
|
|
|
out1:
|
|
out1:
|
|
|
|
|
|
@@ -1000,6 +1021,7 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry,
|
|
up(&JFS_IP(dip)->commit_sem);
|
|
up(&JFS_IP(dip)->commit_sem);
|
|
up(&JFS_IP(ip)->commit_sem);
|
|
up(&JFS_IP(ip)->commit_sem);
|
|
if (rc) {
|
|
if (rc) {
|
|
|
|
+ free_ea_wmap(ip);
|
|
ip->i_nlink = 0;
|
|
ip->i_nlink = 0;
|
|
iput(ip);
|
|
iput(ip);
|
|
} else
|
|
} else
|
|
@@ -1008,11 +1030,6 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry,
|
|
out2:
|
|
out2:
|
|
free_UCSname(&dname);
|
|
free_UCSname(&dname);
|
|
|
|
|
|
-#ifdef CONFIG_JFS_POSIX_ACL
|
|
|
|
- if (rc == 0)
|
|
|
|
- jfs_init_acl(ip, dip);
|
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
out1:
|
|
out1:
|
|
jfs_info("jfs_symlink: rc:%d", rc);
|
|
jfs_info("jfs_symlink: rc:%d", rc);
|
|
return rc;
|
|
return rc;
|
|
@@ -1328,17 +1345,25 @@ static int jfs_mknod(struct inode *dir, struct dentry *dentry,
|
|
down(&JFS_IP(dir)->commit_sem);
|
|
down(&JFS_IP(dir)->commit_sem);
|
|
down(&JFS_IP(ip)->commit_sem);
|
|
down(&JFS_IP(ip)->commit_sem);
|
|
|
|
|
|
- if ((rc = dtSearch(dir, &dname, &ino, &btstack, JFS_CREATE)))
|
|
|
|
|
|
+ rc = jfs_init_acl(tid, ip, dir);
|
|
|
|
+ if (rc)
|
|
goto out3;
|
|
goto out3;
|
|
|
|
|
|
|
|
+ if ((rc = dtSearch(dir, &dname, &ino, &btstack, JFS_CREATE))) {
|
|
|
|
+ txAbort(tid, 0);
|
|
|
|
+ goto out3;
|
|
|
|
+ }
|
|
|
|
+
|
|
tblk = tid_to_tblock(tid);
|
|
tblk = tid_to_tblock(tid);
|
|
tblk->xflag |= COMMIT_CREATE;
|
|
tblk->xflag |= COMMIT_CREATE;
|
|
tblk->ino = ip->i_ino;
|
|
tblk->ino = ip->i_ino;
|
|
tblk->u.ixpxd = JFS_IP(ip)->ixpxd;
|
|
tblk->u.ixpxd = JFS_IP(ip)->ixpxd;
|
|
|
|
|
|
ino = ip->i_ino;
|
|
ino = ip->i_ino;
|
|
- if ((rc = dtInsert(tid, dir, &dname, &ino, &btstack)))
|
|
|
|
|
|
+ if ((rc = dtInsert(tid, dir, &dname, &ino, &btstack))) {
|
|
|
|
+ txAbort(tid, 0);
|
|
goto out3;
|
|
goto out3;
|
|
|
|
+ }
|
|
|
|
|
|
ip->i_op = &jfs_file_inode_operations;
|
|
ip->i_op = &jfs_file_inode_operations;
|
|
jfs_ip->dev = new_encode_dev(rdev);
|
|
jfs_ip->dev = new_encode_dev(rdev);
|
|
@@ -1360,6 +1385,7 @@ static int jfs_mknod(struct inode *dir, struct dentry *dentry,
|
|
up(&JFS_IP(ip)->commit_sem);
|
|
up(&JFS_IP(ip)->commit_sem);
|
|
up(&JFS_IP(dir)->commit_sem);
|
|
up(&JFS_IP(dir)->commit_sem);
|
|
if (rc) {
|
|
if (rc) {
|
|
|
|
+ free_ea_wmap(ip);
|
|
ip->i_nlink = 0;
|
|
ip->i_nlink = 0;
|
|
iput(ip);
|
|
iput(ip);
|
|
} else
|
|
} else
|
|
@@ -1368,11 +1394,6 @@ static int jfs_mknod(struct inode *dir, struct dentry *dentry,
|
|
out1:
|
|
out1:
|
|
free_UCSname(&dname);
|
|
free_UCSname(&dname);
|
|
|
|
|
|
-#ifdef CONFIG_JFS_POSIX_ACL
|
|
|
|
- if (rc == 0)
|
|
|
|
- jfs_init_acl(ip, dir);
|
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
out:
|
|
out:
|
|
jfs_info("jfs_mknod: returning %d", rc);
|
|
jfs_info("jfs_mknod: returning %d", rc);
|
|
return rc;
|
|
return rc;
|