@@ -878,7 +878,8 @@ xfs_ialloc(
uint di_flags = 0;
if (S_ISDIR(mode)) {
- if (pip->i_d.di_flags & XFS_DIFLAG_RTINHERIT)
+ if (!(mp->m_flags & XFS_MOUNT_RTDISABLE) &&
+ pip->i_d.di_flags & XFS_DIFLAG_RTINHERIT)
di_flags |= XFS_DIFLAG_RTINHERIT;
if (pip->i_d.di_flags & XFS_DIFLAG_EXTSZINHERIT) {
di_flags |= XFS_DIFLAG_EXTSZINHERIT;
@@ -887,7 +888,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 (!(mp->m_flags & XFS_MOUNT_RTDISABLE) &&
+ pip->i_d.di_flags & XFS_DIFLAG_RTINHERIT)
di_flags |= XFS_DIFLAG_REALTIME;
if (pip->i_d.di_flags & XFS_DIFLAG_EXTSZINHERIT) {
di_flags |= XFS_DIFLAG_EXTSIZE;
@@ -937,6 +937,7 @@ xfs_set_diflags(
struct xfs_inode *ip,
unsigned int xflags)
{
+ struct xfs_mount *mp = ip->i_mount;
unsigned int di_flags;
uint64_t di_flags2;
@@ -957,7 +958,8 @@ xfs_set_diflags(
if (xflags & FS_XFLAG_FILESTREAM)
di_flags |= XFS_DIFLAG_FILESTREAM;
if (S_ISDIR(VFS_I(ip)->i_mode)) {
- if (xflags & FS_XFLAG_RTINHERIT)
+ if (!(mp->m_flags & XFS_MOUNT_RTDISABLE) &&
+ xflags & FS_XFLAG_RTINHERIT)
di_flags |= XFS_DIFLAG_RTINHERIT;
if (xflags & FS_XFLAG_NOSYMLINKS)
di_flags |= XFS_DIFLAG_NOSYMLINKS;
@@ -966,7 +968,8 @@ xfs_set_diflags(
if (xflags & FS_XFLAG_PROJINHERIT)
di_flags |= XFS_DIFLAG_PROJINHERIT;
} else if (S_ISREG(VFS_I(ip)->i_mode)) {
- if (xflags & FS_XFLAG_REALTIME)
+ if (!(mp->m_flags & XFS_MOUNT_RTDISABLE) &&
+ xflags & FS_XFLAG_REALTIME)
di_flags |= XFS_DIFLAG_REALTIME;
if (xflags & FS_XFLAG_EXTSIZE)
di_flags |= XFS_DIFLAG_EXTSIZE;
@@ -243,6 +243,7 @@ typedef struct xfs_mount {
allocator */
#define XFS_MOUNT_NOATTR2 (1ULL << 25) /* disable use of attr2 format */
+#define XFS_MOUNT_RTDISABLE (1ULL << 61) /* Ignore RT flags */
#define XFS_MOUNT_DAX (1ULL << 62) /* TEST ONLY! */
@@ -83,7 +83,7 @@ enum {
Opt_quota, Opt_noquota, Opt_usrquota, Opt_grpquota, Opt_prjquota,
Opt_uquota, Opt_gquota, Opt_pquota,
Opt_uqnoenforce, Opt_gqnoenforce, Opt_pqnoenforce, Opt_qnoenforce,
- Opt_discard, Opt_nodiscard, Opt_dax, Opt_err,
+ Opt_discard, Opt_nodiscard, Opt_dax, Opt_rtdisable, Opt_err,
};
static const match_table_t tokens = {
@@ -133,6 +133,9 @@ static const match_table_t tokens = {
{Opt_dax, "dax"}, /* Enable direct access to bdev pages */
+#ifdef CONFIG_XFS_RT
+ {Opt_rtdisable, "rtdisable"}, /* Ignore real-time flags */
+#endif
/* Deprecated mount options scheduled for removal */
{Opt_barrier, "barrier"}, /* use writer barriers for log write and
* unwritten extent conversion */
@@ -367,6 +370,11 @@ xfs_parseargs(
case Opt_nodiscard:
mp->m_flags &= ~XFS_MOUNT_DISCARD;
break;
+#ifdef CONFIG_XFS_RT
+ case Opt_rtdisable:
+ mp->m_flags |= XFS_MOUNT_RTDISABLE;
+ break;
+#endif
#ifdef CONFIG_FS_DAX
case Opt_dax:
mp->m_flags |= XFS_MOUNT_DAX;
@@ -492,6 +500,10 @@ xfs_showargs(
{ XFS_MOUNT_DISCARD, ",discard" },
{ XFS_MOUNT_SMALL_INUMS, ",inode32" },
{ XFS_MOUNT_DAX, ",dax" },
+#ifdef CONFIG_XFS_RT
+ { XFS_MOUNT_RTDISABLE, ",rtdisable" },
+#endif
+
{ 0, NULL }
};
static struct proc_xfs_info xfs_info_unset[] = {
- Adds rtdisable mount option to ignore any real-time inheritance flag set on directories. Designed to be used as a "kill-switch" for this behavior, negating the need to walk/kill flags on FS. Signed-off-by: Richard Wareing <rwareing@fb.com> --- fs/xfs/xfs_inode.c | 6 ++++-- fs/xfs/xfs_ioctl.c | 7 +++++-- fs/xfs/xfs_mount.h | 1 + fs/xfs/xfs_super.c | 14 +++++++++++++- 4 files changed, 23 insertions(+), 5 deletions(-)