aboutsummaryrefslogtreecommitdiff
path: root/fs/xfs/linux-2.6/xfs_iops.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-02-06 10:43:13 -0200
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-02-06 10:43:13 -0200
commitb2faf597d93bdf5e2d12d93ea0815935a73f749e (patch)
tree1876616290ff282b8a0814e2429d23e0104f3701 /fs/xfs/linux-2.6/xfs_iops.c
parent638e174688f58200d0deb7435093435e7d737b09 (diff)
parent410c05427a69f53851637ccb85c2212131409fbd (diff)
Merge branch 'origin'
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_iops.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.c50
1 files changed, 32 insertions, 18 deletions
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index 76c6df34d0d..eda7919b70a 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -262,6 +262,31 @@ has_fs_struct(struct task_struct *task)
return (task->fs != init_task.fs);
}
+STATIC inline void
+cleanup_inode(
+ vnode_t *dvp,
+ vnode_t *vp,
+ struct dentry *dentry,
+ int mode)
+{
+ struct dentry teardown = {};
+ int err2;
+
+ /* Oh, the horror.
+ * If we can't add the ACL or we fail in
+ * linvfs_init_security we must back out.
+ * ENOSPC can hit here, among other things.
+ */
+ teardown.d_inode = LINVFS_GET_IP(vp);
+ teardown.d_name = dentry->d_name;
+
+ if (S_ISDIR(mode))
+ VOP_RMDIR(dvp, &teardown, NULL, err2);
+ else
+ VOP_REMOVE(dvp, &teardown, NULL, err2);
+ VN_RELE(vp);
+}
+
STATIC int
linvfs_mknod(
struct inode *dir,
@@ -316,30 +341,19 @@ linvfs_mknod(
}
if (!error)
+ {
error = linvfs_init_security(vp, dir);
+ if (error)
+ cleanup_inode(dvp, vp, dentry, mode);
+ }
if (default_acl) {
if (!error) {
error = _ACL_INHERIT(vp, &va, default_acl);
- if (!error) {
+ if (!error)
VMODIFY(vp);
- } else {
- struct dentry teardown = {};
- int err2;
-
- /* Oh, the horror.
- * If we can't add the ACL we must back out.
- * ENOSPC can hit here, among other things.
- */
- teardown.d_inode = ip = LINVFS_GET_IP(vp);
- teardown.d_name = dentry->d_name;
-
- if (S_ISDIR(mode))
- VOP_RMDIR(dvp, &teardown, NULL, err2);
- else
- VOP_REMOVE(dvp, &teardown, NULL, err2);
- VN_RELE(vp);
- }
+ else
+ cleanup_inode(dvp, vp, dentry, mode);
}
_ACL_FREE(default_acl);
}