diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/fs/ext2/inode.c linux-2.6.25.8-vs2.3.0.34.13/fs/ext2/inode.c
--- linux-2.6.25.8-vs2.3.0.34.12/fs/ext2/inode.c	2008-04-21 10:14:57.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/fs/ext2/inode.c	2008-07-08 16:53:21.000000000 -0400
@@ -1150,15 +1150,14 @@ void ext2_set_inode_flags(struct inode *
 {
 	unsigned int flags = EXT2_I(inode)->i_flags;
 
-	inode->i_flags &= ~(S_IMMUTABLE | S_IUNLINK | S_BARRIER |
+	inode->i_flags &= ~(S_IMMUTABLE | S_IXUNLINK |
 		S_SYNC | S_APPEND | S_NOATIME | S_DIRSYNC);
+	
 
 	if (flags & EXT2_IMMUTABLE_FL)
 		inode->i_flags |= S_IMMUTABLE;
-	if (flags & EXT2_IUNLINK_FL)
-		inode->i_flags |= S_IUNLINK;
-	if (flags & EXT2_BARRIER_FL)
-		inode->i_flags |= S_BARRIER;
+	if (flags & EXT2_IXUNLINK_FL)
+		inode->i_flags |= S_IXUNLINK;
 
 	if (flags & EXT2_SYNC_FL)
 		inode->i_flags |= S_SYNC;
@@ -1168,47 +1167,51 @@ void ext2_set_inode_flags(struct inode *
 		inode->i_flags |= S_NOATIME;
 	if (flags & EXT2_DIRSYNC_FL)
 		inode->i_flags |= S_DIRSYNC;
+
+	inode->i_vflags &= ~(V_BARRIER | V_COW);
+
+	if (flags & EXT2_BARRIER_FL)
+		inode->i_vflags |= V_BARRIER;
+	if (flags & EXT2_COW_FL)
+		inode->i_vflags |= V_COW;
 }
 
 /* Propagate flags from i_flags to EXT2_I(inode)->i_flags */
 void ext2_get_inode_flags(struct ext2_inode_info *ei)
 {
 	unsigned int flags = ei->vfs_inode.i_flags;
+	unsigned int vflags = ei->vfs_inode.i_vflags;
+
+	ei->i_flags &= ~(EXT2_SYNC_FL | EXT2_APPEND_FL |
+			EXT2_IMMUTABLE_FL | EXT2_IXUNLINK_FL |
+			EXT2_NOATIME_FL | EXT2_DIRSYNC_FL |
+			EXT2_BARRIER_FL | EXT2_COW_FL);
+
+	if (flags & S_IMMUTABLE)
+		ei->i_flags |= EXT2_IMMUTABLE_FL;
+	if (flags & S_IXUNLINK)
+		ei->i_flags |= EXT2_IXUNLINK_FL;
 
-	ei->i_flags &= ~(EXT2_SYNC_FL|EXT2_APPEND_FL|
-			EXT2_IMMUTABLE_FL|EXT2_NOATIME_FL|EXT2_DIRSYNC_FL);
 	if (flags & S_SYNC)
 		ei->i_flags |= EXT2_SYNC_FL;
 	if (flags & S_APPEND)
 		ei->i_flags |= EXT2_APPEND_FL;
-	if (flags & S_IMMUTABLE)
-		ei->i_flags |= EXT2_IMMUTABLE_FL;
 	if (flags & S_NOATIME)
 		ei->i_flags |= EXT2_NOATIME_FL;
 	if (flags & S_DIRSYNC)
 		ei->i_flags |= EXT2_DIRSYNC_FL;
+
+	if (vflags & V_BARRIER)
+		ei->i_flags |= EXT2_BARRIER_FL;
+	if (vflags & V_COW)
+		ei->i_flags |= EXT2_COW_FL;
 }
 
 int ext2_sync_flags(struct inode *inode)
 {
-	unsigned int oldflags, newflags;
-
-	oldflags = EXT2_I(inode)->i_flags;
-	newflags = oldflags & ~(EXT2_IMMUTABLE_FL |
-		EXT2_IUNLINK_FL | EXT2_BARRIER_FL);
-
-	if (IS_IMMUTABLE(inode))
-		newflags |= EXT2_IMMUTABLE_FL;
-	if (IS_IUNLINK(inode))
-		newflags |= EXT2_IUNLINK_FL;
-	if (IS_BARRIER(inode))
-		newflags |= EXT2_BARRIER_FL;
-
-	if (oldflags ^ newflags) {
-		EXT2_I(inode)->i_flags = newflags;
-		inode->i_ctime = CURRENT_TIME;
-		mark_inode_dirty(inode);
-	}
+	ext2_get_inode_flags(EXT2_I(inode));
+	inode->i_ctime = CURRENT_TIME;
+	mark_inode_dirty(inode);
 	return 0;
 }
 
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/fs/ext2/ioctl.c linux-2.6.25.8-vs2.3.0.34.13/fs/ext2/ioctl.c
--- linux-2.6.25.8-vs2.3.0.34.12/fs/ext2/ioctl.c	2008-07-08 04:31:24.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/fs/ext2/ioctl.c	2008-07-11 02:48:03.000000000 -0400
@@ -48,6 +48,11 @@ long ext2_ioctl(struct file *filp, unsig
 		if (!S_ISDIR(inode->i_mode))
 			flags &= ~EXT2_DIRSYNC_FL;
 
+		if (IS_BARRIER(inode)) {
+			vxwprintk_task(1, "messing with the barrier.");
+			return -EACCES;
+		}
+
 		mutex_lock(&inode->i_mutex);
 		/* Is it quota file? Do not allow user to mess with it */
 		if (IS_NOQUOTA(inode)) {
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/fs/ext3/inode.c linux-2.6.25.8-vs2.3.0.34.13/fs/ext3/inode.c
--- linux-2.6.25.8-vs2.3.0.34.12/fs/ext3/inode.c	2008-07-08 04:31:24.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/fs/ext3/inode.c	2008-07-08 16:53:39.000000000 -0400
@@ -2623,15 +2623,13 @@ void ext3_set_inode_flags(struct inode *
 {
 	unsigned int flags = EXT3_I(inode)->i_flags;
 
-	inode->i_flags &= ~(S_IMMUTABLE | S_IXUNLINK | S_BARRIER |
+	inode->i_flags &= ~(S_IMMUTABLE | S_IXUNLINK |
 		S_SYNC | S_APPEND | S_NOATIME | S_DIRSYNC);
 
 	if (flags & EXT3_IMMUTABLE_FL)
 		inode->i_flags |= S_IMMUTABLE;
 	if (flags & EXT3_IXUNLINK_FL)
 		inode->i_flags |= S_IXUNLINK;
-	if (flags & EXT3_BARRIER_FL)
-		inode->i_flags |= S_BARRIER;
 
 	if (flags & EXT3_SYNC_FL)
 		inode->i_flags |= S_SYNC;
@@ -2641,63 +2639,67 @@ void ext3_set_inode_flags(struct inode *
 		inode->i_flags |= S_NOATIME;
 	if (flags & EXT3_DIRSYNC_FL)
 		inode->i_flags |= S_DIRSYNC;
+
+	inode->i_vflags &= ~(V_BARRIER | V_COW);
+
+	if (flags & EXT3_BARRIER_FL)
+		inode->i_vflags |= V_BARRIER;
+	if (flags & EXT3_COW_FL)
+		inode->i_vflags |= V_COW;
 }
 
 /* Propagate flags from i_flags to EXT3_I(inode)->i_flags */
 void ext3_get_inode_flags(struct ext3_inode_info *ei)
 {
 	unsigned int flags = ei->vfs_inode.i_flags;
+	unsigned int vflags = ei->vfs_inode.i_vflags;
+
+	ei->i_flags &= ~(EXT3_SYNC_FL | EXT3_APPEND_FL |
+			EXT3_IMMUTABLE_FL | EXT3_IXUNLINK_FL |
+			EXT3_NOATIME_FL | EXT3_DIRSYNC_FL |
+			EXT3_BARRIER_FL | EXT3_COW_FL);
+
+	if (flags & S_IMMUTABLE)
+		ei->i_flags |= EXT3_IMMUTABLE_FL;
+	if (flags & S_IXUNLINK)
+		ei->i_flags |= EXT3_IXUNLINK_FL;
 
-	ei->i_flags &= ~(EXT3_SYNC_FL|EXT3_APPEND_FL|
-			EXT3_IMMUTABLE_FL|EXT3_NOATIME_FL|EXT3_DIRSYNC_FL);
 	if (flags & S_SYNC)
 		ei->i_flags |= EXT3_SYNC_FL;
 	if (flags & S_APPEND)
 		ei->i_flags |= EXT3_APPEND_FL;
-	if (flags & S_IMMUTABLE)
-		ei->i_flags |= EXT3_IMMUTABLE_FL;
 	if (flags & S_NOATIME)
 		ei->i_flags |= EXT3_NOATIME_FL;
 	if (flags & S_DIRSYNC)
 		ei->i_flags |= EXT3_DIRSYNC_FL;
+
+	if (vflags & V_BARRIER)
+		ei->i_flags |= EXT3_BARRIER_FL;
+	if (vflags & V_COW)
+		ei->i_flags |= EXT3_COW_FL;
 }
 
 int ext3_sync_flags(struct inode *inode)
 {
-	unsigned int oldflags, newflags;
-	int err = 0;
-
-	oldflags = EXT3_I(inode)->i_flags;
-	newflags = oldflags & ~(EXT3_IMMUTABLE_FL |
-		EXT3_IXUNLINK_FL | EXT3_BARRIER_FL);
-
-	if (IS_IMMUTABLE(inode))
-		newflags |= EXT3_IMMUTABLE_FL;
-	if (IS_IXUNLINK(inode))
-		newflags |= EXT3_IXUNLINK_FL;
-	if (IS_BARRIER(inode))
-		newflags |= EXT3_BARRIER_FL;
-
-	if (oldflags ^ newflags) {
-		handle_t *handle;
-		struct ext3_iloc iloc;
+	struct ext3_iloc iloc;
+	handle_t *handle;
+	int err;
 
-		handle = ext3_journal_start(inode, 1);
-		if (IS_ERR(handle))
-			return PTR_ERR(handle);
-		if (IS_SYNC(inode))
-			handle->h_sync = 1;
-		err = ext3_reserve_inode_write(handle, inode, &iloc);
-		if (err)
-			goto flags_err;
+	handle = ext3_journal_start(inode, 1);
+	if (IS_ERR(handle))
+		return PTR_ERR(handle);
+	if (IS_SYNC(inode))
+		handle->h_sync = 1;
+	err = ext3_reserve_inode_write(handle, inode, &iloc);
+	if (err)
+		goto flags_err;
 
-		EXT3_I(inode)->i_flags = newflags;
-		inode->i_ctime = CURRENT_TIME;
+	ext3_get_inode_flags(EXT3_I(inode));
+	inode->i_ctime = CURRENT_TIME;
 
-		err = ext3_mark_iloc_dirty(handle, inode, &iloc);
-	flags_err:
-		ext3_journal_stop(handle);
-	}
+	err = ext3_mark_iloc_dirty(handle, inode, &iloc);
+flags_err:
+	ext3_journal_stop(handle);
 	return err;
 }
 
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/fs/ext3/ioctl.c linux-2.6.25.8-vs2.3.0.34.13/fs/ext3/ioctl.c
--- linux-2.6.25.8-vs2.3.0.34.12/fs/ext3/ioctl.c	2008-07-08 04:31:24.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/fs/ext3/ioctl.c	2008-07-11 02:49:40.000000000 -0400
@@ -53,6 +53,11 @@ int ext3_ioctl (struct inode * inode, st
 		if (!S_ISDIR(inode->i_mode))
 			flags &= ~EXT3_DIRSYNC_FL;
 
+		if (IS_BARRIER(inode)) {
+			vxwprintk_task(1, "messing with the barrier.");
+			return -EACCES;
+		}
+
 		mutex_lock(&inode->i_mutex);
 		/* Is it quota file? Do not allow user to mess with it */
 		if (IS_NOQUOTA(inode)) {
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/fs/ext4/inode.c linux-2.6.25.8-vs2.3.0.34.13/fs/ext4/inode.c
--- linux-2.6.25.8-vs2.3.0.34.12/fs/ext4/inode.c	2008-07-08 04:31:24.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/fs/ext4/inode.c	2008-07-11 03:12:05.000000000 -0400
@@ -2672,15 +2672,13 @@ void ext4_set_inode_flags(struct inode *
 {
 	unsigned int flags = EXT4_I(inode)->i_flags;
 
-	inode->i_flags &= ~(S_IMMUTABLE | S_IXUNLINK | S_BARRIER |
+	inode->i_flags &= ~(S_IMMUTABLE | S_IXUNLINK |
 		S_SYNC | S_APPEND | S_NOATIME | S_DIRSYNC);
 
 	if (flags & EXT4_IMMUTABLE_FL)
 		inode->i_flags |= S_IMMUTABLE;
 	if (flags & EXT4_IXUNLINK_FL)
 		inode->i_flags |= S_IXUNLINK;
-	if (flags & EXT4_BARRIER_FL)
-		inode->i_flags |= S_BARRIER;
 
 	if (flags & EXT4_SYNC_FL)
 		inode->i_flags |= S_SYNC;
@@ -2690,63 +2688,67 @@ void ext4_set_inode_flags(struct inode *
 		inode->i_flags |= S_NOATIME;
 	if (flags & EXT4_DIRSYNC_FL)
 		inode->i_flags |= S_DIRSYNC;
+
+	inode->i_vflags &= ~(V_BARRIER | V_COW);
+
+	if (flags & EXT4_BARRIER_FL)
+		inode->i_vflags |= V_BARRIER;
+	if (flags & EXT4_COW_FL)
+		inode->i_vflags |= V_COW;
 }
 
 /* Propagate flags from i_flags to EXT4_I(inode)->i_flags */
 void ext4_get_inode_flags(struct ext4_inode_info *ei)
 {
 	unsigned int flags = ei->vfs_inode.i_flags;
+	unsigned int vflags = ei->vfs_inode.i_vflags;
+
+	ei->i_flags &= ~(EXT4_SYNC_FL | EXT4_APPEND_FL |
+			EXT4_IMMUTABLE_FL | EXT4_IXUNLINK_FL |
+			EXT4_NOATIME_FL | EXT4_DIRSYNC_FL |
+			EXT4_BARRIER_FL | EXT4_COW_FL);
+
+	if (flags & S_IMMUTABLE)
+		ei->i_flags |= EXT4_IMMUTABLE_FL;
+	if (flags & S_IXUNLINK)
+		ei->i_flags |= EXT4_IXUNLINK_FL;
 
-	ei->i_flags &= ~(EXT4_SYNC_FL|EXT4_APPEND_FL|
-			EXT4_IMMUTABLE_FL|EXT4_NOATIME_FL|EXT4_DIRSYNC_FL);
 	if (flags & S_SYNC)
 		ei->i_flags |= EXT4_SYNC_FL;
 	if (flags & S_APPEND)
 		ei->i_flags |= EXT4_APPEND_FL;
-	if (flags & S_IMMUTABLE)
-		ei->i_flags |= EXT4_IMMUTABLE_FL;
 	if (flags & S_NOATIME)
 		ei->i_flags |= EXT4_NOATIME_FL;
 	if (flags & S_DIRSYNC)
 		ei->i_flags |= EXT4_DIRSYNC_FL;
+
+	if (vflags & V_BARRIER)
+		ei->i_flags |= EXT4_BARRIER_FL;
+	if (vflags & V_COW)
+		ei->i_flags |= EXT4_COW_FL;
 }
 
 int ext4_sync_flags(struct inode *inode)
 {
-	unsigned int oldflags, newflags;
-	int err = 0;
-
-	oldflags = EXT4_I(inode)->i_flags;
-	newflags = oldflags & ~(EXT4_IMMUTABLE_FL |
-		EXT4_IXUNLINK_FL | EXT4_BARRIER_FL);
-
-	if (IS_IMMUTABLE(inode))
-		newflags |= EXT4_IMMUTABLE_FL;
-	if (IS_IXUNLINK(inode))
-		newflags |= EXT4_IXUNLINK_FL;
-	if (IS_BARRIER(inode))
-		newflags |= EXT4_BARRIER_FL;
-
-	if (oldflags ^ newflags) {
-		handle_t *handle;
-		struct ext4_iloc iloc;
+	struct ext4_iloc iloc;
+	handle_t *handle;
+	int err;
 
-		handle = ext4_journal_start(inode, 1);
-		if (IS_ERR(handle))
-			return PTR_ERR(handle);
-		if (IS_SYNC(inode))
-			handle->h_sync = 1;
-		err = ext4_reserve_inode_write(handle, inode, &iloc);
-		if (err)
-			goto flags_err;
+	handle = ext4_journal_start(inode, 1);
+	if (IS_ERR(handle))
+		return PTR_ERR(handle);
+	if (IS_SYNC(inode))
+		handle->h_sync = 1;
+	err = ext4_reserve_inode_write(handle, inode, &iloc);
+	if (err)
+		goto flags_err;
 
-		EXT4_I(inode)->i_flags = newflags;
-		inode->i_ctime = CURRENT_TIME;
+	ext4_get_inode_flags(EXT4_I(inode));
+	inode->i_ctime = CURRENT_TIME;
 
-		err = ext4_mark_iloc_dirty(handle, inode, &iloc);
-	flags_err:
-		ext4_journal_stop(handle);
-	}
+	err = ext4_mark_iloc_dirty(handle, inode, &iloc);
+flags_err:
+	ext4_journal_stop(handle);
 	return err;
 }
 
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/fs/ext4/ioctl.c linux-2.6.25.8-vs2.3.0.34.13/fs/ext4/ioctl.c
--- linux-2.6.25.8-vs2.3.0.34.12/fs/ext4/ioctl.c	2008-07-08 04:31:24.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/fs/ext4/ioctl.c	2008-07-11 02:49:54.000000000 -0400
@@ -53,6 +53,11 @@ int ext4_ioctl (struct inode * inode, st
 		if (!S_ISDIR(inode->i_mode))
 			flags &= ~EXT4_DIRSYNC_FL;
 
+		if (IS_BARRIER(inode)) {
+			vxwprintk_task(1, "messing with the barrier.");
+			return -EACCES;
+		}
+
 		mutex_lock(&inode->i_mutex);
 		/* Is it quota file? Do not allow user to mess with it */
 		if (IS_NOQUOTA(inode)) {
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/fs/jfs/ioctl.c linux-2.6.25.8-vs2.3.0.34.13/fs/jfs/ioctl.c
--- linux-2.6.25.8-vs2.3.0.34.12/fs/jfs/ioctl.c	2008-07-08 04:31:24.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/fs/jfs/ioctl.c	2008-07-11 02:50:45.000000000 -0400
@@ -81,6 +81,11 @@ long jfs_ioctl(struct file *filp, unsign
 		if (!S_ISDIR(inode->i_mode))
 			flags &= ~JFS_DIRSYNC_FL;
 
+		if (IS_BARRIER(inode)) {
+			vxwprintk_task(1, "messing with the barrier.");
+			return -EACCES;
+		}
+
 		/* Is it quota file? Do not allow user to mess with it */
 		if (IS_NOQUOTA(inode))
 			return -EPERM;
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/fs/jfs/jfs_dinode.h linux-2.6.25.8-vs2.3.0.34.13/fs/jfs/jfs_dinode.h
--- linux-2.6.25.8-vs2.3.0.34.12/fs/jfs/jfs_dinode.h	2008-07-08 04:31:24.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/fs/jfs/jfs_dinode.h	2008-07-08 13:52:44.000000000 -0400
@@ -161,13 +161,14 @@ struct dinode {
 
 #define JFS_APPEND_FL		0x01000000 /* writes to file may only append */
 #define JFS_IMMUTABLE_FL	0x02000000 /* Immutable file */
+#define JFS_IXUNLINK_FL		0x04000000 /* Immutable invert on unlink */
 
-#define JFS_BARRIER_FL		0x04000000 /* Barrier for chroot() */
-#define JFS_IXUNLINK_FL		0x08000000 /* Immutable unlink */
+#define JFS_BARRIER_FL		0x10000000 /* Barrier for chroot() */
+#define JFS_COW_FL		0x20000000 /* Copy on Write marker */
 
-#define JFS_FL_USER_VISIBLE	0x0FF80000
-#define JFS_FL_USER_MODIFIABLE	0x03F80000
-#define JFS_FL_INHERIT		0x0BC80000
+#define JFS_FL_USER_VISIBLE	0x07F80000
+#define JFS_FL_USER_MODIFIABLE	0x07F80000
+#define JFS_FL_INHERIT		0x03C80000
 
 /* These are identical to EXT[23]_IOC_GETFLAGS/SETFLAGS */
 #define JFS_IOC_GETFLAGS	_IOR('f', 1, long)
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/fs/jfs/jfs_inode.c linux-2.6.25.8-vs2.3.0.34.13/fs/jfs/jfs_inode.c
--- linux-2.6.25.8-vs2.3.0.34.12/fs/jfs/jfs_inode.c	2008-07-08 04:31:24.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/fs/jfs/jfs_inode.c	2008-07-08 05:01:03.000000000 -0400
@@ -32,15 +32,13 @@ void jfs_set_inode_flags(struct inode *i
 {
 	unsigned int flags = JFS_IP(inode)->mode2;
 
-	inode->i_flags &= ~(S_IMMUTABLE | S_IXUNLINK | S_BARRIER |
+	inode->i_flags &= ~(S_IMMUTABLE | S_IXUNLINK |
 		S_SYNC | S_APPEND | S_NOATIME | S_DIRSYNC);
 
 	if (flags & JFS_IMMUTABLE_FL)
 		inode->i_flags |= S_IMMUTABLE;
 	if (flags & JFS_IXUNLINK_FL)
 		inode->i_flags |= S_IXUNLINK;
-	if (flags & JFS_BARRIER_FL)
-		inode->i_flags |= S_BARRIER;
 
 	if (flags & JFS_SYNC_FL)
 		inode->i_flags |= S_SYNC;
@@ -50,39 +48,30 @@ void jfs_set_inode_flags(struct inode *i
 		inode->i_flags |= S_NOATIME;
 	if (flags & JFS_DIRSYNC_FL)
 		inode->i_flags |= S_DIRSYNC;
-}
-
-int jfs_sync_flags(struct inode *inode)
-{
-	unsigned int oldflags, newflags;
 
-	oldflags = JFS_IP(inode)->mode2;
-	newflags = oldflags & ~(JFS_IMMUTABLE_FL |
-		JFS_IXUNLINK_FL | JFS_BARRIER_FL);
-
-	if (IS_IMMUTABLE(inode))
-		newflags |= JFS_IMMUTABLE_FL;
-	if (IS_IXUNLINK(inode))
-		newflags |= JFS_IXUNLINK_FL;
-	if (IS_BARRIER(inode))
-		newflags |= JFS_BARRIER_FL;
+	inode->i_vflags &= ~(V_BARRIER | V_COW);
 
-	if (oldflags ^ newflags) {
-		JFS_IP(inode)->mode2 = newflags;
-		inode->i_ctime = CURRENT_TIME;
-		mark_inode_dirty(inode);
-	}
-	return 0;
+	if (flags & JFS_BARRIER_FL)
+		inode->i_vflags |= V_BARRIER;
+	if (flags & JFS_COW_FL)
+		inode->i_vflags |= V_COW;
 }
 
 void jfs_get_inode_flags(struct jfs_inode_info *jfs_ip)
 {
 	unsigned int flags = jfs_ip->vfs_inode.i_flags;
+	unsigned int vflags = jfs_ip->vfs_inode.i_vflags;
+
+	jfs_ip->mode2 &= ~(JFS_IMMUTABLE_FL | JFS_IXUNLINK_FL |
+			   JFS_APPEND_FL | JFS_NOATIME_FL |
+			   JFS_DIRSYNC_FL | JFS_SYNC_FL |
+			   JFS_BARRIER_FL | JFS_COW_FL);
 
-	jfs_ip->mode2 &= ~(JFS_IMMUTABLE_FL | JFS_APPEND_FL | JFS_NOATIME_FL |
-			   JFS_DIRSYNC_FL | JFS_SYNC_FL);
 	if (flags & S_IMMUTABLE)
 		jfs_ip->mode2 |= JFS_IMMUTABLE_FL;
+	if (flags & S_IXUNLINK)
+		jfs_ip->mode2 |= JFS_IXUNLINK_FL;
+
 	if (flags & S_APPEND)
 		jfs_ip->mode2 |= JFS_APPEND_FL;
 	if (flags & S_NOATIME)
@@ -91,6 +80,19 @@ void jfs_get_inode_flags(struct jfs_inod
 		jfs_ip->mode2 |= JFS_DIRSYNC_FL;
 	if (flags & S_SYNC)
 		jfs_ip->mode2 |= JFS_SYNC_FL;
+
+	if (vflags & V_BARRIER)
+		jfs_ip->mode2 |= JFS_BARRIER_FL;
+	if (vflags & V_COW)
+		jfs_ip->mode2 |= JFS_COW_FL;
+}
+
+int jfs_sync_flags(struct inode *inode)
+{
+	jfs_get_inode_flags(JFS_IP(inode));
+	inode->i_ctime = CURRENT_TIME;
+	mark_inode_dirty(inode);
+	return 0;
 }
 
 /*
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/fs/namei.c linux-2.6.25.8-vs2.3.0.34.13/fs/namei.c
--- linux-2.6.25.8-vs2.3.0.34.12/fs/namei.c	2008-04-22 19:23:22.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/fs/namei.c	2008-07-11 03:07:10.000000000 -0400
@@ -1691,7 +1691,7 @@ int may_open(struct nameidata *nd, int a
 	if (IS_COW(inode) && (flag & FMODE_WRITE)) {
 		if (IS_COW_LINK(inode))
 			return -EMLINK;
-		inode->i_flags &= ~(S_IUNLINK|S_IMMUTABLE);
+		inode->i_flags &= ~(S_IXUNLINK|S_IMMUTABLE);
 		mark_inode_dirty(inode);
 	}
 #endif
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/fs/ocfs2/inode.c linux-2.6.25.8-vs2.3.0.34.13/fs/ocfs2/inode.c
--- linux-2.6.25.8-vs2.3.0.34.12/fs/ocfs2/inode.c	2008-07-08 04:31:24.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/fs/ocfs2/inode.c	2008-07-08 05:10:46.000000000 -0400
@@ -76,15 +76,13 @@ void ocfs2_set_inode_flags(struct inode 
 {
 	unsigned int flags = OCFS2_I(inode)->ip_attr;
 
-	inode->i_flags &= ~(S_IMMUTABLE |
+	inode->i_flags &= ~(S_IMMUTABLE | S_IXUNLINK |
 		S_SYNC | S_APPEND | S_NOATIME | S_DIRSYNC);
 
 	if (flags & OCFS2_IMMUTABLE_FL)
 		inode->i_flags |= S_IMMUTABLE;
 	if (flags & OCFS2_IXUNLINK_FL)
 		inode->i_flags |= S_IXUNLINK;
-	if (flags & OCFS2_BARRIER_FL)
-		inode->i_flags |= S_BARRIER;
 
 	if (flags & OCFS2_SYNC_FL)
 		inode->i_flags |= S_SYNC;
@@ -94,46 +92,89 @@ void ocfs2_set_inode_flags(struct inode 
 		inode->i_flags |= S_NOATIME;
 	if (flags & OCFS2_DIRSYNC_FL)
 		inode->i_flags |= S_DIRSYNC;
+
+	inode->i_vflags &= ~(V_BARRIER | V_COW);
+
+	if (flags & OCFS2_BARRIER_FL)
+		inode->i_vflags |= V_BARRIER;
+	if (flags & OCFS2_COW_FL)
+		inode->i_vflags |= V_COW;
 }
 
 /* Propagate flags from i_flags to OCFS2_I(inode)->ip_attr */
 void ocfs2_get_inode_flags(struct ocfs2_inode_info *oi)
 {
 	unsigned int flags = oi->vfs_inode.i_flags;
+	unsigned int vflags = oi->vfs_inode.i_vflags;
+
+	oi->ip_attr &= ~(OCFS2_SYNC_FL | OCFS2_APPEND_FL |
+			OCFS2_IMMUTABLE_FL | OCFS2_IXUNLINK_FL |
+			OCFS2_NOATIME_FL | OCFS2_DIRSYNC_FL
+			OCFS2_BARRIER_FL | OCFS2_COW_FL);
+
+	if (flags & S_IMMUTABLE)
+		oi->ip_attr |= OCFS2_IMMUTABLE_FL;
+	if (flags & S_IXUNLINK)
+		oi->ip_attr |= OCFS2_IXUNLINK_FL;
 
-	oi->ip_attr &= ~(OCFS2_SYNC_FL|OCFS2_APPEND_FL|
-			OCFS2_IMMUTABLE_FL|OCFS2_NOATIME_FL|OCFS2_DIRSYNC_FL);
 	if (flags & S_SYNC)
 		oi->ip_attr |= OCFS2_SYNC_FL;
 	if (flags & S_APPEND)
 		oi->ip_attr |= OCFS2_APPEND_FL;
-	if (flags & S_IMMUTABLE)
-		oi->ip_attr |= OCFS2_IMMUTABLE_FL;
 	if (flags & S_NOATIME)
 		oi->ip_attr |= OCFS2_NOATIME_FL;
 	if (flags & S_DIRSYNC)
 		oi->ip_attr |= OCFS2_DIRSYNC_FL;
+
+	if (vflags & V_BARRIER)
+		oi->ip_attr |= OCFS2_BARRIER_FL;
+	if (vflags & V_COW)
+		oi->ip_attr |= OCFS2_COW_FL;
 }
 
 int ocfs2_sync_flags(struct inode *inode)
 {
-	unsigned int oldflags, newflags;
+	struct ocfs2_inode_info *ocfs2_inode = OCFS2_I(inode);
+	struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
+	handle_t *handle = NULL;
+	struct buffer_head *bh = NULL;
+	int status;
 
-	oldflags = OCFS2_I(inode)->ip_flags;
-	newflags = oldflags & ~(OCFS2_IMMUTABLE_FL |
-		OCFS2_IXUNLINK_FL | OCFS2_BARRIER_FL);
+	mutex_lock(&inode->i_mutex);
 
-	if (IS_IMMUTABLE(inode))
-		newflags |= OCFS2_IMMUTABLE_FL;
-	if (IS_IXUNLINK(inode))
-		newflags |= OCFS2_IXUNLINK_FL;
-	if (IS_BARRIER(inode))
-		newflags |= OCFS2_BARRIER_FL;
+	status = ocfs2_inode_lock(inode, &bh, 1);
+	if (status < 0) {
+		mlog_errno(status);
+		goto bail;
+	}
 
-	if (oldflags ^ newflags)
-		return ocfs2_set_inode_attr(inode,
-			newflags, OCFS2_FL_MASK);
-	return 0;
+	status = -EROFS;
+	if (IS_RDONLY(inode))
+		goto bail_unlock;
+
+	handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
+	if (IS_ERR(handle)) {
+		status = PTR_ERR(handle);
+		mlog_errno(status);
+		goto bail_unlock;
+	}
+
+	ocfs2_set_inode_flags(inode);
+	status = ocfs2_mark_inode_dirty(handle, inode, bh);
+	if (status < 0)
+		mlog_errno(status);
+
+	ocfs2_commit_trans(osb, handle);
+bail_unlock:
+	ocfs2_inode_unlock(inode, 1);
+bail:
+	mutex_unlock(&inode->i_mutex);
+
+	if (bh)
+		brelse(bh);
+
+	mlog_exit(status);
+	return status;
 }
 
 struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, unsigned flags,
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/fs/ocfs2/ioctl.c linux-2.6.25.8-vs2.3.0.34.13/fs/ocfs2/ioctl.c
--- linux-2.6.25.8-vs2.3.0.34.12/fs/ocfs2/ioctl.c	2008-04-19 15:14:52.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/fs/ocfs2/ioctl.c	2008-07-11 02:51:27.000000000 -0400
@@ -70,6 +70,11 @@ int ocfs2_set_inode_attr(struct inode *i
 	if (!S_ISDIR(inode->i_mode))
 		flags &= ~OCFS2_DIRSYNC_FL;
 
+	if (IS_BARRIER(inode)) {
+		vxwprintk_task(1, "messing with the barrier.");
+		goto bail_unlock;
+	}
+
 	handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
 	if (IS_ERR(handle)) {
 		status = PTR_ERR(handle);
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/fs/ocfs2/ocfs2_fs.h linux-2.6.25.8-vs2.3.0.34.13/fs/ocfs2/ocfs2_fs.h
--- linux-2.6.25.8-vs2.3.0.34.12/fs/ocfs2/ocfs2_fs.h	2008-07-08 04:31:24.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/fs/ocfs2/ocfs2_fs.h	2008-07-08 13:51:49.000000000 -0400
@@ -187,13 +187,14 @@
 #define OCFS2_NODUMP_FL		(0x00000040)	/* do not dump file */
 #define OCFS2_NOATIME_FL	(0x00000080)	/* do not update atime */
 #define OCFS2_DIRSYNC_FL	(0x00010000)	/* dirsync behaviour (directories only) */
+#define OCFS2_IXUNLINK_FL	(0x00020000)	/* Immutable invert on unlink */
 
-#define OCFS2_BARRIER_FL	(0x04000000)	/* Barrier for chroot() */
-#define OCFS2_IXUNLINK_FL	(0x08000000)	/* Immutable unlink */
+#define OCFS2_BARRIER_FL	(0x01000000)	/* Barrier for chroot() */
+#define OCFS2_COW_FL		(0x02000000)	/* Copy on Write marker */
 
-#define OCFS2_FL_VISIBLE	(0x000100FF)	/* User visible flags */
-#define OCFS2_FL_MODIFIABLE	(0x000100FF)	/* User modifiable flags */
-#define OCFS2_FL_MASK		(0x0F0100FF)
+#define OCFS2_FL_VISIBLE	(0x000300FF)	/* User visible flags */
+#define OCFS2_FL_MODIFIABLE	(0x000300FF)	/* User modifiable flags */
+#define OCFS2_FL_MASK		(0x030300FF)
 
 /*
  * Extent record flags (e_node.leaf.flags)
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/fs/reiserfs/inode.c linux-2.6.25.8-vs2.3.0.34.13/fs/reiserfs/inode.c
--- linux-2.6.25.8-vs2.3.0.34.12/fs/reiserfs/inode.c	2008-07-08 04:31:24.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/fs/reiserfs/inode.c	2008-07-08 05:17:07.000000000 -0400
@@ -2860,10 +2860,6 @@ int reiserfs_commit_write(struct file *f
 void sd_attrs_to_i_attrs(__u16 sd_attrs, struct inode *inode)
 {
 	if (reiserfs_attrs(inode->i_sb)) {
-		if (sd_attrs & REISERFS_SYNC_FL)
-			inode->i_flags |= S_SYNC;
-		else
-			inode->i_flags &= ~S_SYNC;
 		if (sd_attrs & REISERFS_IMMUTABLE_FL)
 			inode->i_flags |= S_IMMUTABLE;
 		else
@@ -2872,10 +2868,11 @@ void sd_attrs_to_i_attrs(__u16 sd_attrs,
 			inode->i_flags |= S_IXUNLINK;
 		else
 			inode->i_flags &= ~S_IXUNLINK;
-		if (sd_attrs & REISERFS_BARRIER_FL)
-			inode->i_flags |= S_BARRIER;
+
+		if (sd_attrs & REISERFS_SYNC_FL)
+			inode->i_flags |= S_SYNC;
 		else
-			inode->i_flags &= ~S_BARRIER;
+			inode->i_flags &= ~S_SYNC;
 		if (sd_attrs & REISERFS_APPEND_FL)
 			inode->i_flags |= S_APPEND;
 		else
@@ -2888,6 +2885,15 @@ void sd_attrs_to_i_attrs(__u16 sd_attrs,
 			REISERFS_I(inode)->i_flags |= i_nopack_mask;
 		else
 			REISERFS_I(inode)->i_flags &= ~i_nopack_mask;
+
+		if (sd_attrs & REISERFS_BARRIER_FL)
+			inode->i_vflags |= V_BARRIER;
+		else
+			inode->i_vflags &= ~V_BARRIER;
+		if (sd_attrs & REISERFS_COW_FL)
+			inode->i_vflags |= V_COW;
+		else
+			inode->i_vflags &= ~V_COW;
 	}
 }
 
@@ -2902,10 +2908,7 @@ void i_attrs_to_sd_attrs(struct inode *i
 			*sd_attrs |= REISERFS_IXUNLINK_FL;
 		else
 			*sd_attrs &= ~REISERFS_IXUNLINK_FL;
-		if (inode->i_flags & S_BARRIER)
-			*sd_attrs |= REISERFS_BARRIER_FL;
-		else
-			*sd_attrs &= ~REISERFS_BARRIER_FL;
+
 		if (inode->i_flags & S_SYNC)
 			*sd_attrs |= REISERFS_SYNC_FL;
 		else
@@ -2918,6 +2921,15 @@ void i_attrs_to_sd_attrs(struct inode *i
 			*sd_attrs |= REISERFS_NOTAIL_FL;
 		else
 			*sd_attrs &= ~REISERFS_NOTAIL_FL;
+
+		if (inode->i_vflags & V_BARRIER)
+			*sd_attrs |= REISERFS_BARRIER_FL;
+		else
+			*sd_attrs &= ~REISERFS_BARRIER_FL;
+		if (inode->i_vflags & V_COW)
+			*sd_attrs |= REISERFS_COW_FL;
+		else
+			*sd_attrs &= ~REISERFS_COW_FL;
 	}
 }
 
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/fs/reiserfs/ioctl.c linux-2.6.25.8-vs2.3.0.34.13/fs/reiserfs/ioctl.c
--- linux-2.6.25.8-vs2.3.0.34.12/fs/reiserfs/ioctl.c	2008-05-21 14:30:41.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/fs/reiserfs/ioctl.c	2008-07-11 02:52:05.000000000 -0400
@@ -58,6 +58,11 @@ int reiserfs_ioctl(struct inode *inode, 
 			if (get_user(flags, (int __user *)arg))
 				return -EFAULT;
 
+			if (IS_BARRIER(inode)) {
+				vxwprintk_task(1, "messing with the barrier.");
+				return -EACCES;
+			}
+
 			/* Is it quota file? Do not allow user to mess with it. */
 			if (IS_NOQUOTA(inode))
 				return -EPERM;
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/fs/xfs/linux-2.6/xfs_ioctl.c linux-2.6.25.8-vs2.3.0.34.13/fs/xfs/linux-2.6/xfs_ioctl.c
--- linux-2.6.25.8-vs2.3.0.34.12/fs/xfs/linux-2.6/xfs_ioctl.c	2008-07-08 04:31:24.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/fs/xfs/linux-2.6/xfs_ioctl.c	2008-07-11 02:57:05.000000000 -0400
@@ -770,9 +770,13 @@ xfs_ioctl(
 		return xfs_ioc_fsgetxattr(ip, 0, arg);
 	case XFS_IOC_FSGETXATTRA:
 		return xfs_ioc_fsgetxattr(ip, 1, arg);
-	case XFS_IOC_GETXFLAGS:
 	case XFS_IOC_SETXFLAGS:
 	case XFS_IOC_FSSETXATTR:
+		if (IS_BARRIER(inode)) {
+			vxwprintk_task(1, "messing with the barrier.");
+			return -XFS_ERROR(EACCES);
+		}
+	case XFS_IOC_GETXFLAGS:
 		return xfs_ioc_xattr(ip, filp, cmd, arg);
 
 	case XFS_IOC_FSSETDM: {
@@ -1132,6 +1136,9 @@ xfs_di2lxflags(
 
 	if (di_flags & XFS_DIFLAG_IMMUTABLE)
 		flags |= FS_IMMUTABLE_FL;
+	if (di_flags & XFS_DIFLAG_IXUNLINK)
+		flags |= FS_IXUNLINK_FL;
+
 	if (di_flags & XFS_DIFLAG_APPEND)
 		flags |= FS_APPEND_FL;
 	if (di_flags & XFS_DIFLAG_SYNC)
@@ -1141,10 +1148,10 @@ xfs_di2lxflags(
 	if (di_flags & XFS_DIFLAG_NODUMP)
 		flags |= FS_NODUMP_FL;
 
-	if (di_vflags & XFS_DIVFLAG_IXUNLINK)
-		flags |= FS_IXUNLINK_FL;
 	if (di_vflags & XFS_DIVFLAG_BARRIER)
 		flags |= FS_BARRIER_FL;
+	if (di_vflags & XFS_DIVFLAG_COW)
+		flags |= FS_COW_FL;
 	return flags;
 }
 
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/fs/xfs/linux-2.6/xfs_iops.c linux-2.6.25.8-vs2.3.0.34.13/fs/xfs/linux-2.6/xfs_iops.c
--- linux-2.6.25.8-vs2.3.0.34.12/fs/xfs/linux-2.6/xfs_iops.c	2008-07-08 04:31:24.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/fs/xfs/linux-2.6/xfs_iops.c	2008-07-10 23:30:31.000000000 -0400
@@ -734,15 +734,18 @@ xfs_vn_sync_flags(struct inode *inode)
 	if (error)
 		return error;
 	oldflags = vattr.va_xflags;
-	newflags = oldflags & ~(XFS_XFLAG_IMMUTABLE |
-		XFS_XFLAG_IXUNLINK | XFS_XFLAG_BARRIER);
+	newflags = oldflags & ~(XFS_XFLAG_IMMUTABLE | XFS_XFLAG_IXUNLINK
+		| XFS_XFLAG_BARRIER | XFS_XFLAG_COW);
 
 	if (IS_IMMUTABLE(inode))
 		newflags |= XFS_XFLAG_IMMUTABLE;
 	if (IS_IXUNLINK(inode))
 		newflags |= XFS_XFLAG_IXUNLINK;
+
 	if (IS_BARRIER(inode))
 		newflags |= XFS_XFLAG_BARRIER;
+	if (IS_COW(inode))
+		newflags |= XFS_XFLAG_COW;
 
 	if (oldflags ^ newflags) {
 		vattr.va_xflags = newflags;
@@ -908,6 +911,7 @@ const struct inode_operations xfs_inode_
 	.listxattr		= xfs_vn_listxattr,
 	.removexattr		= xfs_vn_removexattr,
 	.fallocate		= xfs_vn_fallocate,
+	.sync_flags		= xfs_vn_sync_flags,
 };
 
 const struct inode_operations xfs_dir_inode_operations = {
@@ -928,7 +932,6 @@ const struct inode_operations xfs_dir_in
 	.listxattr		= xfs_vn_listxattr,
 	.removexattr		= xfs_vn_removexattr,
 	.sync_flags		= xfs_vn_sync_flags,
-	.sync_flags		= xfs_vn_sync_flags,
 };
 
 const struct inode_operations xfs_symlink_inode_operations = {
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/fs/xfs/linux-2.6/xfs_super.c linux-2.6.25.8-vs2.3.0.34.13/fs/xfs/linux-2.6/xfs_super.c
--- linux-2.6.25.8-vs2.3.0.34.12/fs/xfs/linux-2.6/xfs_super.c	2008-07-08 04:31:24.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/fs/xfs/linux-2.6/xfs_super.c	2008-07-11 00:48:43.000000000 -0400
@@ -634,6 +634,11 @@ xfs_revalidate_inode(
 		inode->i_flags |= S_IMMUTABLE;
 	else
 		inode->i_flags &= ~S_IMMUTABLE;
+	if (ip->i_d.di_flags & XFS_DIFLAG_IXUNLINK)
+		inode->i_flags |= S_IXUNLINK;
+	else
+		inode->i_flags &= ~S_IXUNLINK;
+
 	if (ip->i_d.di_flags & XFS_DIFLAG_APPEND)
 		inode->i_flags |= S_APPEND;
 	else
@@ -647,14 +652,15 @@ xfs_revalidate_inode(
 	else
 		inode->i_flags &= ~S_NOATIME;
 
-	if (ip->i_d.di_vflags & XFS_DIVFLAG_IXUNLINK)
-		inode->i_flags |= S_IXUNLINK;
-	else
-		inode->i_flags &= ~S_IXUNLINK;
 	if (ip->i_d.di_vflags & XFS_DIVFLAG_BARRIER)
-		inode->i_flags |= S_BARRIER;
+		inode->i_vflags |= V_BARRIER;
 	else
-		inode->i_flags &= ~S_BARRIER;
+		inode->i_vflags &= ~V_BARRIER;
+	if (ip->i_d.di_vflags & XFS_DIVFLAG_COW)
+		inode->i_vflags |= V_COW;
+	else
+		inode->i_vflags &= ~V_COW;
+
 	xfs_iflags_clear(ip, XFS_IMODIFIED);
 }
 
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/fs/xfs/linux-2.6/xfs_vnode.c linux-2.6.25.8-vs2.3.0.34.13/fs/xfs/linux-2.6/xfs_vnode.c
--- linux-2.6.25.8-vs2.3.0.34.12/fs/xfs/linux-2.6/xfs_vnode.c	2008-07-08 04:31:24.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/fs/xfs/linux-2.6/xfs_vnode.c	2008-07-08 16:54:48.000000000 -0400
@@ -120,10 +120,6 @@ vn_revalidate(
 		inode->i_flags |= S_IXUNLINK;
 	else
 		inode->i_flags &= ~S_IXUNLINK;
-	if (xflags & XFS_XFLAG_BARRIER)
-		inode->i_flags |= S_BARRIER;
-	else
-		inode->i_flags &= ~S_BARRIER;
 	if (xflags & XFS_XFLAG_APPEND)
 		inode->i_flags |= S_APPEND;
 	else
@@ -136,6 +132,15 @@ vn_revalidate(
 		inode->i_flags |= S_NOATIME;
 	else
 		inode->i_flags &= ~S_NOATIME;
+
+	if (xflags & XFS_XFLAG_BARRIER)
+		inode->i_vflags |= V_BARRIER;
+	else
+		inode->i_vflags &= ~V_BARRIER;
+	if (xflags & XFS_XFLAG_COW)
+		inode->i_vflags |= V_COW;
+	else
+		inode->i_vflags &= ~V_COW;
 	xfs_iunlock(ip, XFS_ILOCK_SHARED);
 
 	xfs_iflags_clear(ip, XFS_IMODIFIED);
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/fs/xfs/xfs_clnt.h linux-2.6.25.8-vs2.3.0.34.13/fs/xfs/xfs_clnt.h
--- linux-2.6.25.8-vs2.3.0.34.12/fs/xfs/xfs_clnt.h	2008-04-19 15:14:52.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/fs/xfs/xfs_clnt.h	2008-07-11 01:28:55.000000000 -0400
@@ -100,6 +100,6 @@ struct xfs_mount_args {
 						 * I/O size in stat(2) */
 #define XFSMNT2_FILESTREAMS	0x00000002	/* enable the filestreams
 						 * allocator */
-#define XFSMNT2_TAGGED		0x80000000	/* context tagging */
+#define XFSMNT2_TAGGED		0x10000000	/* context tagging */
 
 #endif	/* __XFS_CLNT_H__ */
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/fs/xfs/xfs_dinode.h linux-2.6.25.8-vs2.3.0.34.13/fs/xfs/xfs_dinode.h
--- linux-2.6.25.8-vs2.3.0.34.12/fs/xfs/xfs_dinode.h	2008-07-08 04:31:24.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/fs/xfs/xfs_dinode.h	2008-07-11 00:30:17.000000000 -0400
@@ -138,8 +138,8 @@ typedef struct xfs_dinode
 #define	XFS_DI_NEXT_UNLINKED	0x1000000
 #define	XFS_DI_U		0x2000000
 #define	XFS_DI_A		0x4000000
-#define	XFS_DI_VFLAGS		0x8000000
-#define	XFS_DI_TAG		0x10000000
+#define	XFS_DI_TAG		0x8000000
+#define	XFS_DI_VFLAGS		0x10000000
 #define	XFS_DI_NUM_BITS		29
 #define	XFS_DI_ALL_BITS		((1 << XFS_DI_NUM_BITS) - 1)
 #define	XFS_DI_CORE_BITS	(XFS_DI_ALL_BITS & ~(XFS_DI_U|XFS_DI_A))
@@ -227,6 +227,7 @@ typedef enum xfs_dinode_fmt
 #define XFS_DIFLAG_EXTSZINHERIT_BIT 12	/* inherit inode extent size */
 #define XFS_DIFLAG_NODEFRAG_BIT     13	/* do not reorganize/defragment */
 #define XFS_DIFLAG_FILESTREAM_BIT   14  /* use filestream allocator */
+#define XFS_DIFLAG_IXUNLINK_BIT     15	/* Immutable inver on unlink */
 
 #define XFS_DIFLAG_REALTIME      (1 << XFS_DIFLAG_REALTIME_BIT)
 #define XFS_DIFLAG_PREALLOC      (1 << XFS_DIFLAG_PREALLOC_BIT)
@@ -243,6 +244,7 @@ typedef enum xfs_dinode_fmt
 #define XFS_DIFLAG_EXTSZINHERIT  (1 << XFS_DIFLAG_EXTSZINHERIT_BIT)
 #define XFS_DIFLAG_NODEFRAG      (1 << XFS_DIFLAG_NODEFRAG_BIT)
 #define XFS_DIFLAG_FILESTREAM    (1 << XFS_DIFLAG_FILESTREAM_BIT)
+#define XFS_DIFLAG_IXUNLINK      (1 << XFS_DIFLAG_IXUNLINK_BIT)
 
 #ifdef CONFIG_XFS_RT
 #define XFS_IS_REALTIME_INODE(ip) ((ip)->i_d.di_flags & XFS_DIFLAG_REALTIME)
@@ -255,9 +257,10 @@ typedef enum xfs_dinode_fmt
 	 XFS_DIFLAG_IMMUTABLE | XFS_DIFLAG_APPEND | XFS_DIFLAG_SYNC | \
 	 XFS_DIFLAG_NOATIME | XFS_DIFLAG_NODUMP | XFS_DIFLAG_RTINHERIT | \
 	 XFS_DIFLAG_PROJINHERIT | XFS_DIFLAG_NOSYMLINKS | XFS_DIFLAG_EXTSIZE | \
-	 XFS_DIFLAG_EXTSZINHERIT | XFS_DIFLAG_NODEFRAG | XFS_DIFLAG_FILESTREAM)
+	 XFS_DIFLAG_EXTSZINHERIT | XFS_DIFLAG_NODEFRAG | XFS_DIFLAG_FILESTREAM | \
+	 XFS_DIFLAG_IXUNLINK)
 
-#define	XFS_DIVFLAG_BARRIER	0x01
-#define	XFS_DIVFLAG_IXUNLINK	0x02
+#define XFS_DIVFLAG_BARRIER	0x01
+#define XFS_DIVFLAG_COW		0x02
 
 #endif	/* __XFS_DINODE_H__ */
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/fs/xfs/xfs_fs.h linux-2.6.25.8-vs2.3.0.34.13/fs/xfs/xfs_fs.h
--- linux-2.6.25.8-vs2.3.0.34.12/fs/xfs/xfs_fs.h	2008-07-08 04:31:24.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/fs/xfs/xfs_fs.h	2008-07-08 16:11:02.000000000 -0400
@@ -67,8 +67,9 @@ struct fsxattr {
 #define XFS_XFLAG_EXTSZINHERIT	0x00001000	/* inherit inode extent size */
 #define XFS_XFLAG_NODEFRAG	0x00002000  	/* do not defragment */
 #define XFS_XFLAG_FILESTREAM	0x00004000	/* use filestream allocator */
+#define XFS_XFLAG_IXUNLINK	0x00008000	/* immutable invert on unlink */
 #define XFS_XFLAG_BARRIER	0x10000000	/* chroot() barrier */
-#define XFS_XFLAG_IXUNLINK	0x20000000	/* immutable unlink */
+#define XFS_XFLAG_COW		0x20000000	/* copy on write mark */
 #define XFS_XFLAG_HASATTR	0x80000000	/* no DIFLAG for this	*/
 
 /*
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/fs/xfs/xfs_ialloc.c linux-2.6.25.8-vs2.3.0.34.13/fs/xfs/xfs_ialloc.c
--- linux-2.6.25.8-vs2.3.0.34.12/fs/xfs/xfs_ialloc.c	2008-04-27 10:30:39.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/fs/xfs/xfs_ialloc.c	2008-07-11 00:30:58.000000000 -0400
@@ -66,8 +66,6 @@ xfs_ialloc_log_di(
 		offsetof(xfs_dinode_core_t, di_gid),
 		offsetof(xfs_dinode_core_t, di_nlink),
 		offsetof(xfs_dinode_core_t, di_projid),
-		offsetof(xfs_dinode_core_t, di_tag),
-		offsetof(xfs_dinode_core_t, di_vflags),
 		offsetof(xfs_dinode_core_t, di_pad),
 		offsetof(xfs_dinode_core_t, di_atime),
 		offsetof(xfs_dinode_core_t, di_mtime),
@@ -86,6 +84,8 @@ xfs_ialloc_log_di(
 		offsetof(xfs_dinode_t, di_next_unlinked),
 		offsetof(xfs_dinode_t, di_u),
 		offsetof(xfs_dinode_t, di_a),
+		offsetof(xfs_dinode_core_t, di_tag),
+		offsetof(xfs_dinode_core_t, di_vflags),
 		sizeof(xfs_dinode_t)
 	};
 
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/fs/xfs/xfs_inode.c linux-2.6.25.8-vs2.3.0.34.13/fs/xfs/xfs_inode.c
--- linux-2.6.25.8-vs2.3.0.34.12/fs/xfs/xfs_inode.c	2008-07-08 04:31:24.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/fs/xfs/xfs_inode.c	2008-07-11 01:49:20.000000000 -0400
@@ -715,9 +715,10 @@ xfs_iformat_btree(
 void
 xfs_dinode_from_disk(
 	xfs_icdinode_t		*to,
-	xfs_dinode_core_t	*from)
+	xfs_dinode_core_t	*from,
+	int tagged)
 {
-	uint32_t uid, gid;
+	uint32_t uid, gid, tag;
 
 	to->di_magic = be16_to_cpu(from->di_magic);
 	to->di_mode = be16_to_cpu(from->di_mode);
@@ -727,10 +728,11 @@ xfs_dinode_from_disk(
 
 	uid = be32_to_cpu(from->di_uid);
 	gid = be32_to_cpu(from->di_gid);
+	tag = be16_to_cpu(from->di_tag);
 
-	to->di_uid = INOTAG_UID(1, uid, gid);
-	to->di_gid = INOTAG_GID(1, uid, gid);
-	to->di_tag = INOTAG_TAG(1, uid, gid, 0);
+	to->di_uid = INOTAG_UID(tagged, uid, gid);
+	to->di_gid = INOTAG_GID(tagged, uid, gid);
+	to->di_tag = INOTAG_TAG(tagged, uid, gid, tag);
 
 	to->di_nlink = be32_to_cpu(from->di_nlink);
 	to->di_projid = be16_to_cpu(from->di_projid);
@@ -752,13 +754,15 @@ xfs_dinode_from_disk(
 	to->di_dmevmask	= be32_to_cpu(from->di_dmevmask);
 	to->di_dmstate	= be16_to_cpu(from->di_dmstate);
 	to->di_flags	= be16_to_cpu(from->di_flags);
+	to->di_vflags	= be16_to_cpu(from->di_vflags);
 	to->di_gen	= be32_to_cpu(from->di_gen);
 }
 
 void
 xfs_dinode_to_disk(
 	xfs_dinode_core_t	*to,
-	xfs_icdinode_t		*from)
+	xfs_icdinode_t		*from,
+	int tagged)
 {
 	to->di_magic = cpu_to_be16(from->di_magic);
 	to->di_mode = cpu_to_be16(from->di_mode);
@@ -766,8 +770,9 @@ xfs_dinode_to_disk(
 	to->di_format = from->di_format;
 	to->di_onlink = cpu_to_be16(from->di_onlink);
 
-	to->di_uid = cpu_to_be32(TAGINO_UID(1, from->di_uid, from->di_tag));
-	to->di_gid = cpu_to_be32(TAGINO_GID(1, from->di_gid, from->di_tag));
+	to->di_uid = cpu_to_be32(TAGINO_UID(tagged, from->di_uid, from->di_tag));
+	to->di_gid = cpu_to_be32(TAGINO_GID(tagged, from->di_gid, from->di_tag));
+	to->di_tag = cpu_to_be16(TAGINO_TAG(tagged, from->di_tag));
 
 	to->di_nlink = cpu_to_be32(from->di_nlink);
 	to->di_projid = cpu_to_be16(from->di_projid);
@@ -789,6 +794,7 @@ xfs_dinode_to_disk(
 	to->di_dmevmask = cpu_to_be32(from->di_dmevmask);
 	to->di_dmstate = cpu_to_be16(from->di_dmstate);
 	to->di_flags = cpu_to_be16(from->di_flags);
+	to->di_vflags = cpu_to_be16(from->di_vflags);
 	to->di_gen = cpu_to_be32(from->di_gen);
 }
 
@@ -806,6 +812,8 @@ _xfs_dic2xflags(
 			flags |= XFS_XFLAG_PREALLOC;
 		if (di_flags & XFS_DIFLAG_IMMUTABLE)
 			flags |= XFS_XFLAG_IMMUTABLE;
+		if (di_flags & XFS_DIFLAG_IXUNLINK)
+			flags |= XFS_XFLAG_IXUNLINK;
 		if (di_flags & XFS_DIFLAG_APPEND)
 			flags |= XFS_XFLAG_APPEND;
 		if (di_flags & XFS_DIFLAG_SYNC)
@@ -829,10 +837,10 @@ _xfs_dic2xflags(
 		if (di_flags & XFS_DIFLAG_FILESTREAM)
 			flags |= XFS_XFLAG_FILESTREAM;
 	}
-	if (di_vflags & XFS_DIVFLAG_IXUNLINK)
-		flags |= XFS_XFLAG_IXUNLINK;
 	if (di_vflags & XFS_DIVFLAG_BARRIER)
 		flags |= XFS_XFLAG_BARRIER;
+	if (di_vflags & XFS_DIVFLAG_COW)
+		flags |= XFS_XFLAG_COW;
 	return flags;
 }
 
@@ -947,7 +955,8 @@ xfs_iread(
 	 * Otherwise, just get the truly permanent information.
 	 */
 	if (dip->di_core.di_mode) {
-		xfs_dinode_from_disk(&ip->i_d, &dip->di_core);
+		xfs_dinode_from_disk(&ip->i_d, &dip->di_core,
+			mp->m_flags & XFS_MOUNT_TAGGED);
 		error = xfs_iformat(ip, dip);
 		if (error)  {
 			kmem_zone_free(xfs_inode_zone, ip);
@@ -1208,6 +1217,7 @@ xfs_ialloc(
 	ip->i_d.di_dmevmask = 0;
 	ip->i_d.di_dmstate = 0;
 	ip->i_d.di_flags = 0;
+	ip->i_d.di_vflags = 0;
 	flags = XFS_ILOG_CORE;
 	switch (mode & S_IFMT) {
 	case S_IFIFO:
@@ -2402,6 +2412,7 @@ xfs_ifree(
 	}
 	ip->i_d.di_mode = 0;		/* mark incore inode as free */
 	ip->i_d.di_flags = 0;
+	ip->i_d.di_vflags = 0;
 	ip->i_d.di_dmevmask = 0;
 	ip->i_d.di_forkoff = 0;		/* mark the attr fork not in use */
 	ip->i_df.if_ext_max =
@@ -3437,7 +3448,8 @@ xfs_iflush_int(
 	 * because if the inode is dirty at all the core must
 	 * be.
 	 */
-	xfs_dinode_to_disk(&dip->di_core, &ip->i_d);
+	xfs_dinode_to_disk(&dip->di_core, &ip->i_d,
+		mp->m_flags & XFS_MOUNT_TAGGED);
 
 	/* Wrap, we never let the log put out DI_MAX_FLUSH */
 	if (ip->i_d.di_flushiter == DI_MAX_FLUSH)
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/fs/xfs/xfs_inode.h linux-2.6.25.8-vs2.3.0.34.13/fs/xfs/xfs_inode.h
--- linux-2.6.25.8-vs2.3.0.34.12/fs/xfs/xfs_inode.h	2008-04-19 15:14:52.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/fs/xfs/xfs_inode.h	2008-07-11 01:44:30.000000000 -0400
@@ -525,9 +525,9 @@ int		xfs_ialloc(struct xfs_trans *, xfs_
 			   xfs_nlink_t, xfs_dev_t, struct cred *, xfs_prid_t,
 			   int, struct xfs_buf **, boolean_t *, xfs_inode_t **);
 void		xfs_dinode_from_disk(struct xfs_icdinode *,
-				     struct xfs_dinode_core *);
+				     struct xfs_dinode_core *, int tagged);
 void		xfs_dinode_to_disk(struct xfs_dinode_core *,
-				   struct xfs_icdinode *);
+				   struct xfs_icdinode *, int tagged);
 
 uint		xfs_ip2xflags(struct xfs_inode *);
 uint		xfs_dic2xflags(struct xfs_dinode *);
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/fs/xfs/xfs_log_recover.c linux-2.6.25.8-vs2.3.0.34.13/fs/xfs/xfs_log_recover.c
--- linux-2.6.25.8-vs2.3.0.34.12/fs/xfs/xfs_log_recover.c	2008-04-17 12:05:43.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/fs/xfs/xfs_log_recover.c	2008-07-11 01:52:59.000000000 -0400
@@ -2410,7 +2410,8 @@ xlog_recover_do_inode_trans(
 
 	/* The core is in in-core format */
 	xfs_dinode_to_disk(&dip->di_core,
-		(xfs_icdinode_t *)item->ri_buf[1].i_addr);
+		(xfs_icdinode_t *)item->ri_buf[1].i_addr,
+		mp->m_flags & XFS_MOUNT_TAGGED);
 
 	/* the rest is in on-disk format */
 	if (item->ri_buf[1].i_len > sizeof(xfs_dinode_core_t)) {
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/fs/xfs/xfs_vnodeops.c linux-2.6.25.8-vs2.3.0.34.13/fs/xfs/xfs_vnodeops.c
--- linux-2.6.25.8-vs2.3.0.34.12/fs/xfs/xfs_vnodeops.c	2008-07-08 04:31:24.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/fs/xfs/xfs_vnodeops.c	2008-07-08 16:08:14.000000000 -0400
@@ -560,7 +560,7 @@ xfs_setattr(
 		 */
 		if ((mask & XFS_AT_XFLAGS) &&
 		    (ip->i_d.di_flags &
-				(XFS_DIFLAG_IMMUTABLE|XFS_DIFLAG_APPEND) ||
+				(XFS_DIFLAG_IMMUTABLE | XFS_DIFLAG_APPEND) ||
 		     (vap->va_xflags &
 				(XFS_XFLAG_IMMUTABLE | XFS_XFLAG_APPEND))) &&
 		    !capable(CAP_LINUX_IMMUTABLE)) {
@@ -794,6 +794,8 @@ xfs_setattr(
 			di_flags = (ip->i_d.di_flags & XFS_DIFLAG_PREALLOC);
 			if (vap->va_xflags & XFS_XFLAG_IMMUTABLE)
 				di_flags |= XFS_DIFLAG_IMMUTABLE;
+			if (vap->va_xflags & XFS_XFLAG_IXUNLINK)
+				di_flags |= XFS_DIFLAG_IXUNLINK;
 			if (vap->va_xflags & XFS_XFLAG_APPEND)
 				di_flags |= XFS_DIFLAG_APPEND;
 			if (vap->va_xflags & XFS_XFLAG_SYNC)
@@ -822,10 +824,10 @@ xfs_setattr(
 					di_flags |= XFS_DIFLAG_EXTSIZE;
 			}
 			ip->i_d.di_flags = di_flags;
-			if (vap->va_xflags & XFS_XFLAG_IXUNLINK)
-				di_vflags |= XFS_DIVFLAG_IXUNLINK;
 			if (vap->va_xflags & XFS_XFLAG_BARRIER)
 				di_vflags |= XFS_DIVFLAG_BARRIER;
+			if (vap->va_xflags & XFS_XFLAG_COW)
+				di_vflags |= XFS_DIVFLAG_COW;
 			ip->i_d.di_vflags = di_vflags;
 		}
 		xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/include/linux/ext2_fs.h linux-2.6.25.8-vs2.3.0.34.13/include/linux/ext2_fs.h
--- linux-2.6.25.8-vs2.3.0.34.12/include/linux/ext2_fs.h	2008-07-08 04:31:24.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/include/linux/ext2_fs.h	2008-07-08 13:53:46.000000000 -0400
@@ -189,10 +189,12 @@ struct ext2_group_desc
 #define EXT2_NOTAIL_FL			FS_NOTAIL_FL	/* file tail should not be merged */
 #define EXT2_DIRSYNC_FL			FS_DIRSYNC_FL	/* dirsync behaviour (directories only) */
 #define EXT2_TOPDIR_FL			FS_TOPDIR_FL	/* Top of directory hierarchies*/
-#define EXT2_BARRIER_FL			FS_BARRIER_FL	/* Barrier for chroot() */
-#define EXT2_IXUNLINK_FL			FS_IXUNLINK_FL	/* Immutable unlink */
+#define EXT2_IXUNLINK_FL		FS_IXUNLINK_FL	/* Immutable invert on unlink */
 #define EXT2_RESERVED_FL		FS_RESERVED_FL	/* reserved for ext2 lib */
 
+#define EXT2_BARRIER_FL			FS_BARRIER_FL	/* Barrier for chroot() */
+#define EXT2_COW_FL			FS_COW_FL	/* Copy on Write marker */
+
 #define EXT2_FL_USER_VISIBLE		FS_FL_USER_VISIBLE	/* User visible flags */
 #define EXT2_FL_USER_MODIFIABLE		FS_FL_USER_MODIFIABLE	/* User modifiable flags */
 
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/include/linux/ext3_fs.h linux-2.6.25.8-vs2.3.0.34.13/include/linux/ext3_fs.h
--- linux-2.6.25.8-vs2.3.0.34.12/include/linux/ext3_fs.h	2008-07-08 04:31:24.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/include/linux/ext3_fs.h	2008-07-08 14:08:49.000000000 -0400
@@ -173,12 +173,14 @@ struct ext3_group_desc
 #define EXT3_NOTAIL_FL			0x00008000 /* file tail should not be merged */
 #define EXT3_DIRSYNC_FL			0x00010000 /* dirsync behaviour (directories only) */
 #define EXT3_TOPDIR_FL			0x00020000 /* Top of directory hierarchies*/
-#define EXT3_BARRIER_FL			0x04000000 /* Barrier for chroot() */
-#define EXT3_IXUNLINK_FL			0x08000000 /* Immutable unlink */
+#define EXT3_IXUNLINK_FL		0x01000000 /* Immutable invert on unlink */
 #define EXT3_RESERVED_FL		0x80000000 /* reserved for ext3 lib */
 
-#define EXT3_FL_USER_VISIBLE		0x0003DFFF /* User visible flags */
-#define EXT3_FL_USER_MODIFIABLE		0x000380FF /* User modifiable flags */
+#define EXT3_BARRIER_FL			0x10000000 /* Barrier for chroot() */
+#define EXT3_COW_FL			0x20000000 /* Copy on Write marker */
+
+#define EXT3_FL_USER_VISIBLE		0x0103DFFF /* User visible flags */
+#define EXT3_FL_USER_MODIFIABLE		0x010380FF /* User modifiable flags */
 
 /*
  * Inode dynamic state flags
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/include/linux/ext4_fs.h linux-2.6.25.8-vs2.3.0.34.13/include/linux/ext4_fs.h
--- linux-2.6.25.8-vs2.3.0.34.12/include/linux/ext4_fs.h	2008-07-08 04:31:24.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/include/linux/ext4_fs.h	2008-07-08 14:09:54.000000000 -0400
@@ -231,12 +231,14 @@ struct ext4_group_desc
 #define EXT4_TOPDIR_FL			0x00020000 /* Top of directory hierarchies*/
 #define EXT4_HUGE_FILE_FL               0x00040000 /* Set to each huge file */
 #define EXT4_EXTENTS_FL			0x00080000 /* Inode uses extents */
-#define EXT4_BARRIER_FL			0x04000000 /* Barrier for chroot() */
-#define EXT4_IXUNLINK_FL			0x08000000 /* Immutable unlink */
+#define EXT4_IXUNLINK_FL		0x01000000 /* Immutable invert on unlink */
 #define EXT4_RESERVED_FL		0x80000000 /* reserved for ext4 lib */
 
-#define EXT4_FL_USER_VISIBLE		0x000BDFFF /* User visible flags */
-#define EXT4_FL_USER_MODIFIABLE		0x000380FF /* User modifiable flags */
+#define EXT4_BARRIER_FL			0x10000000 /* Barrier for chroot() */
+#define EXT4_COW_FL			0x20000000 /* Copy on Write marker */
+
+#define EXT4_FL_USER_VISIBLE		0x010BDFFF /* User visible flags */
+#define EXT4_FL_USER_MODIFIABLE		0x010380FF /* User modifiable flags */
 
 /*
  * Inode dynamic state flags
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/include/linux/fs.h linux-2.6.25.8-vs2.3.0.34.13/include/linux/fs.h
--- linux-2.6.25.8-vs2.3.0.34.12/include/linux/fs.h	2008-04-19 15:37:28.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/include/linux/fs.h	2008-07-08 16:56:52.000000000 -0400
@@ -153,8 +153,14 @@ extern int dir_notify_enable;
 #define S_NOCMTIME	128	/* Do not update file c/mtime */
 #define S_SWAPFILE	256	/* Do not truncate: swapon got its bmaps */
 #define S_PRIVATE	512	/* Inode is fs-internal */
-#define S_BARRIER	1024	/* Barrier for chroot() */
-#define S_IUNLINK	2048	/* Immutable unlink */
+#define S_IXUNLINK	1024	/* Immutable Invert on unlink */
+
+/* Linux-VServer related Inode flags */
+
+#define V_VALID		1
+#define V_XATTR		2
+#define V_BARRIER	4	/* Barrier for chroot() */
+#define V_COW		8	/* Copy on Write */
 
 /*
  * Note that nosuid etc flags are inode-specific: setting some file-system
@@ -184,18 +190,19 @@ extern int dir_notify_enable;
 #define IS_NOQUOTA(inode)	((inode)->i_flags & S_NOQUOTA)
 #define IS_APPEND(inode)	((inode)->i_flags & S_APPEND)
 #define IS_IMMUTABLE(inode)	((inode)->i_flags & S_IMMUTABLE)
-#define IS_IUNLINK(inode)	((inode)->i_flags & S_IUNLINK)
-#define IS_IXORUNLINK(inode)	((IS_IUNLINK(inode) ? S_IMMUTABLE : 0) ^ IS_IMMUTABLE(inode))
+#define IS_IXUNLINK(inode)	((inode)->i_flags & S_IXUNLINK)
+#define IS_IXORUNLINK(inode)	((IS_IXUNLINK(inode) ? S_IMMUTABLE : 0) ^ IS_IMMUTABLE(inode))
 #define IS_POSIXACL(inode)	__IS_FLG(inode, MS_POSIXACL)
 
-#define IS_BARRIER(inode)	(S_ISDIR((inode)->i_mode) && ((inode)->i_flags & S_BARRIER))
 #define IS_DEADDIR(inode)	((inode)->i_flags & S_DEAD)
 #define IS_NOCMTIME(inode)	((inode)->i_flags & S_NOCMTIME)
 #define IS_SWAPFILE(inode)	((inode)->i_flags & S_SWAPFILE)
 #define IS_PRIVATE(inode)	((inode)->i_flags & S_PRIVATE)
 
+#define IS_BARRIER(inode)	(S_ISDIR((inode)->i_mode) && ((inode)->i_vflags & V_BARRIER))
+
 #ifdef CONFIG_VSERVER_COWBL
-#  define IS_COW(inode)		(IS_IUNLINK(inode) && IS_IMMUTABLE(inode))
+#  define IS_COW(inode)		(IS_IXUNLINK(inode) && IS_IMMUTABLE(inode))
 #  define IS_COW_LINK(inode)	(S_ISREG((inode)->i_mode) && ((inode)->i_nlink > 1))
 #else
 #  define IS_COW(inode)		(0)
@@ -275,12 +282,14 @@ extern int dir_notify_enable;
 #define FS_TOPDIR_FL			0x00020000 /* Top of directory hierarchies*/
 #define FS_EXTENT_FL			0x00080000 /* Extents */
 #define FS_DIRECTIO_FL			0x00100000 /* Use direct i/o */
-#define FS_BARRIER_FL			0x04000000 /* Barrier for chroot() */
-#define FS_IUNLINK_FL			0x08000000 /* Immutable unlink */
+#define FS_IXUNLINK_FL			0x01000000 /* Immutable invert on unlink */
 #define FS_RESERVED_FL			0x80000000 /* reserved for ext2 lib */
 
-#define FS_FL_USER_VISIBLE		0x0003DFFF /* User visible flags */
-#define FS_FL_USER_MODIFIABLE		0x000380FF /* User modifiable flags */
+#define FS_BARRIER_FL			0x10000000 /* Barrier for chroot() */
+#define FS_COW_FL			0x20000000 /* Copy on Write marker */
+
+#define FS_FL_USER_VISIBLE		0x0103DFFF /* User visible flags */
+#define FS_FL_USER_MODIFIABLE		0x010380FF /* User modifiable flags */
 
 #define SYNC_FILE_RANGE_WAIT_BEFORE	1
 #define SYNC_FILE_RANGE_WRITE		2
@@ -382,7 +391,7 @@ struct iattr {
 };
 
 #define ATTR_FLAG_BARRIER	512	/* Barrier for chroot() */
-#define ATTR_FLAG_IUNLINK	1024	/* Immutable unlink */
+#define ATTR_FLAG_IXUNLINK	1024	/* Immutable invert on unlink */
 
 /*
  * Includes for diskquotas.
@@ -672,7 +681,8 @@ struct inode {
 	unsigned long		i_state;
 	unsigned long		dirtied_when;	/* jiffies of first dirtying */
 
-	unsigned int		i_flags;
+	unsigned short		i_flags;
+	unsigned short		i_vflags;
 
 	atomic_t		i_writecount;
 #ifdef CONFIG_SECURITY
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/include/linux/reiserfs_fs.h linux-2.6.25.8-vs2.3.0.34.13/include/linux/reiserfs_fs.h
--- linux-2.6.25.8-vs2.3.0.34.12/include/linux/reiserfs_fs.h	2008-07-08 04:31:24.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/include/linux/reiserfs_fs.h	2008-07-08 14:14:46.000000000 -0400
@@ -838,8 +838,9 @@ struct stat_data_v1 {
 #define REISERFS_NOTAIL_FL    FS_NOTAIL_FL
 
 /* unfortunately reiserfs sdattr is only 16 bit */
+#define REISERFS_IXUNLINK_FL  (FS_IXUNLINK_FL >> 16)
 #define REISERFS_BARRIER_FL   (FS_BARRIER_FL >> 16)
-#define REISERFS_IXUNLINK_FL   (FS_IXUNLINK_FL >> 16)
+#define REISERFS_COW_FL       (FS_COW_FL >> 16)
 
 /* persistent flags that file inherits from the parent directory */
 #define REISERFS_INHERIT_MASK ( REISERFS_IMMUTABLE_FL |	\
diff -NurpP --minimal linux-2.6.25.8-vs2.3.0.34.12/kernel/vserver/inode.c linux-2.6.25.8-vs2.3.0.34.13/kernel/vserver/inode.c
--- linux-2.6.25.8-vs2.3.0.34.12/kernel/vserver/inode.c	2008-07-08 04:31:24.000000000 -0400
+++ linux-2.6.25.8-vs2.3.0.34.13/kernel/vserver/inode.c	2008-07-08 13:41:38.000000000 -0400
@@ -195,9 +195,9 @@ static int __vc_set_iattr(struct dentry 
 		}
 		if (S_ISDIR(in->i_mode) && (*mask & IATTR_BARRIER)) {
 			if (*flags & IATTR_BARRIER)
-				in->i_flags |= S_BARRIER;
+				in->i_vflags |= V_BARRIER;
 			else
-				in->i_flags &= ~S_BARRIER;
+				in->i_vflags &= ~V_BARRIER;
 		}
 		if (in->i_op && in->i_op->sync_flags) {
 			error = in->i_op->sync_flags(in);
