Message ID | 159950166858.582172.16284988680675778406.stgit@magnolia (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | xfs: fix a few realtime bugs | expand |
On Mon, Sep 07, 2020 at 11:01:08AM -0700, Darrick J. Wong wrote: > From: Darrick J. Wong <darrick.wong@oracle.com> > > While running generic/042 with -drtinherit=1 set in MKFS_OPTIONS, I > observed that the kernel will gladly set the realtime flag on any file > created on the loopback filesystem even though that filesystem doesn't > actually have a realtime device attached. This leads to verifier > failures and doesn't make any sense, so be smarter about this. Looks good, but add an overly long line. Which just suggested that the whole flag inheritance really needs to be split into a helper..
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index c06129cffba9..10312e1ae60c 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -870,7 +870,8 @@ xfs_ialloc( if (pip->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) di_flags |= XFS_DIFLAG_PROJINHERIT; } else if (S_ISREG(mode)) { - if (pip->i_d.di_flags & XFS_DIFLAG_RTINHERIT) + if ((pip->i_d.di_flags & XFS_DIFLAG_RTINHERIT) && + xfs_sb_version_hasrealtime(&mp->m_sb)) di_flags |= XFS_DIFLAG_REALTIME; if (pip->i_d.di_flags & XFS_DIFLAG_EXTSZINHERIT) { di_flags |= XFS_DIFLAG_EXTSIZE;