Skip to content

Commit d09840f

Browse files
committed
Merge tag 'xfs-6.11-fixes-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Pull xfs fixes from Chandan Babu: - Check for presence of only 'attr' feature before scrubbing an inode's attribute fork. - Restore the behaviour of setting AIL thread to TASK_INTERRUPTIBLE for long (i.e. 50ms) sleep durations to prevent high load averages. - Do not allow users to change the realtime flag of a file unless the datadev and rtdev both support fsdax access modes. * tag 'xfs-6.11-fixes-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: conditionally allow FS_XFLAG_REALTIME changes if S_DAX is set xfs: revert AIL TASK_KILLABLE threshold xfs: attr forks require attr, not attr2
2 parents b718175 + 8d16762 commit d09840f

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

fs/xfs/scrub/bmap.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,13 @@ xchk_bmap(
938938
}
939939
break;
940940
case XFS_ATTR_FORK:
941-
if (!xfs_has_attr(mp) && !xfs_has_attr2(mp))
941+
/*
942+
* "attr" means that an attr fork was created at some point in
943+
* the life of this filesystem. "attr2" means that inodes have
944+
* variable-sized data/attr fork areas. Hence we only check
945+
* attr here.
946+
*/
947+
if (!xfs_has_attr(mp))
942948
xchk_ino_set_corrupt(sc, sc->ip->i_ino);
943949
break;
944950
default:

fs/xfs/xfs_ioctl.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,17 @@ xfs_ioctl_setattr_xflags(
483483
/* Can't change realtime flag if any extents are allocated. */
484484
if (ip->i_df.if_nextents || ip->i_delayed_blks)
485485
return -EINVAL;
486+
487+
/*
488+
* If S_DAX is enabled on this file, we can only switch the
489+
* device if both support fsdax. We can't update S_DAX because
490+
* there might be other threads walking down the access paths.
491+
*/
492+
if (IS_DAX(VFS_I(ip)) &&
493+
(mp->m_ddev_targp->bt_daxdev == NULL ||
494+
(mp->m_rtdev_targp &&
495+
mp->m_rtdev_targp->bt_daxdev == NULL)))
496+
return -EINVAL;
486497
}
487498

488499
if (rtflag) {

fs/xfs/xfs_trans_ail.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,12 @@ xfsaild(
644644
set_freezable();
645645

646646
while (1) {
647-
if (tout)
647+
/*
648+
* Long waits of 50ms or more occur when we've run out of items
649+
* to push, so we only want uninterruptible state if we're
650+
* actually blocked on something.
651+
*/
652+
if (tout && tout <= 20)
648653
set_current_state(TASK_KILLABLE|TASK_FREEZABLE);
649654
else
650655
set_current_state(TASK_INTERRUPTIBLE|TASK_FREEZABLE);

0 commit comments

Comments
 (0)