--- linux-2.6.18.2/fs/ext2/namei.c 2006-06-18 04:54:33 +0200 +++ linux-2.6.18.2-vs2.1.1/fs/ext2/namei.c 2006-11-04 08:24:09 +0100 @@ -66,6 +67,7 @@ static struct dentry *ext2_lookup(struct inode = iget(dir->i_sb, ino); if (!inode) return ERR_PTR(-EACCES); + dx_propagate_tag(nd, inode); } return d_splice_alias(inode, dentry); } --- linux-2.6.18.2/fs/ext3/namei.c 2006-09-20 16:58:34 +0200 +++ linux-2.6.18.2-vs2.1.1/fs/ext3/namei.c 2006-09-25 15:40:02 +0200 @@ -1009,6 +1010,7 @@ static struct dentry *ext3_lookup(struct if (!inode) return ERR_PTR(-EACCES); + dx_propagate_tag(nd, inode); } return d_splice_alias(inode, dentry); } --- linux-2.6.18.2/fs/jfs/namei.c 2006-09-20 16:58:35 +0200 +++ linux-2.6.18.2-vs2.1.1/fs/jfs/namei.c 2006-09-25 15:40:02 +0200 @@ -1464,6 +1465,7 @@ static struct dentry *jfs_lookup(struct return ERR_PTR(-EACCES); } + dx_propagate_tag(nd, ip); dentry = d_splice_alias(ip, dentry); if (dentry && (JFS_SBI(dip->i_sb)->mntflag & JFS_OS2)) --- linux-2.6.18.2/fs/namespace.c 2006-09-20 16:58:35 +0200 +++ linux-2.6.18.2-vs2.1.1/fs/namespace.c 2006-09-25 15:40:02 +0200 @@ -1402,7 +1467,19 @@ long do_mount(char *dev_name, char *dir_ if (data_page) ((char *)data_page)[PAGE_SIZE - 1] = 0; +#ifdef CONFIG_PROPAGATE + retval = dx_parse_tag(data_page, &tag, 1); + if (retval) { + mnt_flags |= MNT_TAGID; + /* bind and re-mounts get the tag flag */ + if (flags & (MS_BIND|MS_REMOUNT)) + flags |= MS_TAGID; + } +#endif + /* Separate the per-mountpoint flags */ + if (flags & MS_RDONLY) + mnt_flags |= MNT_RDONLY; if (flags & MS_NOSUID) mnt_flags |= MNT_NOSUID; if (flags & MS_NODEV) --- linux-2.6.18.2/fs/nfs/dir.c 2006-11-04 19:43:23 +0100 +++ linux-2.6.18.2-vs2.1.1/fs/nfs/dir.c 2006-11-04 19:12:54 +0100 @@ -928,6 +930,7 @@ static struct dentry *nfs_lookup(struct res = (struct dentry *)inode; if (IS_ERR(res)) goto out_unlock; + dx_propagate_tag(nd, inode); no_entry: res = d_add_unique(dentry, inode); if (res != NULL) --- linux-2.6.18.2/fs/reiserfs/namei.c 2006-09-20 16:58:35 +0200 +++ linux-2.6.18.2-vs2.1.1/fs/reiserfs/namei.c 2006-09-25 15:40:02 +0200 @@ -364,6 +365,7 @@ static struct dentry *reiserfs_lookup(st reiserfs_write_unlock(dir->i_sb); return ERR_PTR(-EACCES); } + dx_propagate_tag(nd, inode); /* Propogate the priv_object flag so we know we're in the priv tree */ if (is_reiserfs_priv_object(dir)) --- linux-2.6.18.2/fs/reiserfs/namei.c 2006-09-20 16:58:35 +0200 +++ linux-2.6.18.2-vs2.1.1/fs/reiserfs/namei.c 2006-09-25 15:40:02 +0200 @@ -599,6 +601,7 @@ static int new_inode_init(struct inode * } else { inode->i_gid = current->fsgid; } + inode->i_tag = dx_current_fstag(inode->i_sb); DQUOT_INIT(inode); return 0; } --- linux-2.6.18.2/fs/xfs/linux-2.6/xfs_iops.c 2006-09-20 16:58:39 +0200 +++ linux-2.6.18.2-vs2.1.1/fs/xfs/linux-2.6/xfs_iops.c 2006-09-25 15:40:02 +0200 @@ -402,6 +403,7 @@ xfs_vn_lookup( d_add(dentry, NULL); return NULL; } + dx_propagate_tag(nd, vn_to_inode(cvp)); return d_splice_alias(vn_to_inode(cvp), dentry); } --- linux-2.6.18.2/fs/xfs/linux-2.6/xfs_linux.h 2006-09-20 16:58:39 +0200 +++ linux-2.6.18.2-vs2.1.1/fs/xfs/linux-2.6/xfs_linux.h 2006-09-25 17:25:34 +0200 @@ -139,6 +139,7 @@ BUFFER_FNS(PrivateStart, unwritten); #define current_pid() (current->pid) #define current_fsuid(cred) (current->fsuid) #define current_fsgid(cred) (current->fsgid) +#define current_fstag(cred,vp) (dx_current_fstag(vn_to_inode(vp)->i_sb)) #define current_test_flags(f) (current->flags & (f)) #define current_set_flags_nested(sp, f) \ (*(sp) = current->flags, current->flags |= (f)) --- linux-2.6.18.2/fs/xfs/xfs_inode.c 2006-09-20 16:58:40 +0200 +++ linux-2.6.18.2-vs2.1.1/fs/xfs/xfs_inode.c 2006-09-25 15:40:02 +0200 @@ -1126,6 +1146,7 @@ xfs_ialloc( ASSERT(ip->i_d.di_nlink == nlink); ip->i_d.di_uid = current_fsuid(cr); ip->i_d.di_gid = current_fsgid(cr); + ip->i_d.di_tag = current_fstag(cr, vp); ip->i_d.di_projid = prid; memset(&(ip->i_d.di_pad[0]), 0, sizeof(ip->i_d.di_pad)); --- linux-2.6.18.2/fs/xfs/xfs_vfsops.c 2006-09-20 16:58:40 +0200 +++ linux-2.6.18.2-vs2.1.1/fs/xfs/xfs_vfsops.c 2006-09-25 15:40:02 +0200 @@ -394,6 +396,8 @@ xfs_finish_flags( return XFS_ERROR(EINVAL); } + if (ap->flags2 & XFSMNT2_TAGGED) + vfs->vfs_super->s_flags |= MS_TAGGED; return 0; } --- linux-2.6.18.2/include/linux/mount.h 2006-09-20 16:58:44 +0200 +++ linux-2.6.18.2-vs2.1.1/include/linux/mount.h 2006-09-25 15:40:02 +0200 @@ -33,6 +36,7 @@ ***** #define MNT_SHARED 0x1000 /* if the vfsmount is a shared mount */ #define MNT_UNBINDABLE 0x2000 /* if the vfsmount is a unbindable mount */ #define MNT_PNODE_MASK 0x3000 /* propogation flag mask */ +#define MNT_TAGID 0x8000 struct vfsmount { struct list_head mnt_hash; --- linux-2.6.18.2/include/linux/mount.h 2006-09-20 16:58:44 +0200 +++ linux-2.6.18.2-vs2.1.1/include/linux/mount.h 2006-09-25 15:40:02 +0200 @@ -54,6 +58,7 @@ struct vfsmount { struct vfsmount *mnt_master; /* slave is on master->mnt_slave_list */ struct namespace *mnt_namespace; /* containing namespace */ int mnt_pinned; + tag_t mnt_tag; /* tagging used for vfsmount */ }; static inline struct vfsmount *mntget(struct vfsmount *mnt)