diff options
author | Dave Chinner <dchinner@redhat.com> | 2014-10-01 19:18:40 -0400 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2014-10-01 19:18:40 -0400 |
commit | 9336e3a765b68d4a7fdd8256f393ebce95ecb0a7 (patch) | |
tree | c80f6c580eade5ae8876ca3740fc62608aaa82f0 /fs/xfs | |
parent | e076b0f3a5c472e77c0a0e163188f2761e8b4fed (diff) |
xfs: project id inheritance is a directory only flag
xfs_set_diflags() allows it to be set on non-directory inodes, and
this flags errors in xfs_repair. Further, inode allocation allows
the same directory-only flag to be inherited to non-directories.
Make sure directory inode flags don't appear on other types of
inodes.
This fixes several xfstests scratch fileystem corruption reports
(e.g. xfs/050) now that xfstests checks scratch filesystems after
test completion.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_inode.c | 4 | ||||
-rw-r--r-- | fs/xfs/xfs_ioctl.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 4c130ffcf0cf..2f63742a25f3 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -769,6 +769,8 @@ xfs_ialloc( | |||
769 | di_flags |= XFS_DIFLAG_EXTSZINHERIT; | 769 | di_flags |= XFS_DIFLAG_EXTSZINHERIT; |
770 | ip->i_d.di_extsize = pip->i_d.di_extsize; | 770 | ip->i_d.di_extsize = pip->i_d.di_extsize; |
771 | } | 771 | } |
772 | if (pip->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) | ||
773 | di_flags |= XFS_DIFLAG_PROJINHERIT; | ||
772 | } else if (S_ISREG(mode)) { | 774 | } else if (S_ISREG(mode)) { |
773 | if (pip->i_d.di_flags & XFS_DIFLAG_RTINHERIT) | 775 | if (pip->i_d.di_flags & XFS_DIFLAG_RTINHERIT) |
774 | di_flags |= XFS_DIFLAG_REALTIME; | 776 | di_flags |= XFS_DIFLAG_REALTIME; |
@@ -789,8 +791,6 @@ xfs_ialloc( | |||
789 | if ((pip->i_d.di_flags & XFS_DIFLAG_NOSYMLINKS) && | 791 | if ((pip->i_d.di_flags & XFS_DIFLAG_NOSYMLINKS) && |
790 | xfs_inherit_nosymlinks) | 792 | xfs_inherit_nosymlinks) |
791 | di_flags |= XFS_DIFLAG_NOSYMLINKS; | 793 | di_flags |= XFS_DIFLAG_NOSYMLINKS; |
792 | if (pip->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) | ||
793 | di_flags |= XFS_DIFLAG_PROJINHERIT; | ||
794 | if ((pip->i_d.di_flags & XFS_DIFLAG_NODEFRAG) && | 794 | if ((pip->i_d.di_flags & XFS_DIFLAG_NODEFRAG) && |
795 | xfs_inherit_nodefrag) | 795 | xfs_inherit_nodefrag) |
796 | di_flags |= XFS_DIFLAG_NODEFRAG; | 796 | di_flags |= XFS_DIFLAG_NODEFRAG; |
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 3799695b9249..05a19554efbc 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c | |||
@@ -968,8 +968,6 @@ xfs_set_diflags( | |||
968 | di_flags |= XFS_DIFLAG_NOATIME; | 968 | di_flags |= XFS_DIFLAG_NOATIME; |
969 | if (xflags & XFS_XFLAG_NODUMP) | 969 | if (xflags & XFS_XFLAG_NODUMP) |
970 | di_flags |= XFS_DIFLAG_NODUMP; | 970 | di_flags |= XFS_DIFLAG_NODUMP; |
971 | if (xflags & XFS_XFLAG_PROJINHERIT) | ||
972 | di_flags |= XFS_DIFLAG_PROJINHERIT; | ||
973 | if (xflags & XFS_XFLAG_NODEFRAG) | 971 | if (xflags & XFS_XFLAG_NODEFRAG) |
974 | di_flags |= XFS_DIFLAG_NODEFRAG; | 972 | di_flags |= XFS_DIFLAG_NODEFRAG; |
975 | if (xflags & XFS_XFLAG_FILESTREAM) | 973 | if (xflags & XFS_XFLAG_FILESTREAM) |
@@ -981,6 +979,8 @@ xfs_set_diflags( | |||
981 | di_flags |= XFS_DIFLAG_NOSYMLINKS; | 979 | di_flags |= XFS_DIFLAG_NOSYMLINKS; |
982 | if (xflags & XFS_XFLAG_EXTSZINHERIT) | 980 | if (xflags & XFS_XFLAG_EXTSZINHERIT) |
983 | di_flags |= XFS_DIFLAG_EXTSZINHERIT; | 981 | di_flags |= XFS_DIFLAG_EXTSZINHERIT; |
982 | if (xflags & XFS_XFLAG_PROJINHERIT) | ||
983 | di_flags |= XFS_DIFLAG_PROJINHERIT; | ||
984 | } else if (S_ISREG(ip->i_d.di_mode)) { | 984 | } else if (S_ISREG(ip->i_d.di_mode)) { |
985 | if (xflags & XFS_XFLAG_REALTIME) | 985 | if (xflags & XFS_XFLAG_REALTIME) |
986 | di_flags |= XFS_DIFLAG_REALTIME; | 986 | di_flags |= XFS_DIFLAG_REALTIME; |