]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.15
authorSasha Levin <sashal@kernel.org>
Wed, 18 Jun 2025 01:35:06 +0000 (21:35 -0400)
committerSasha Levin <sashal@kernel.org>
Wed, 18 Jun 2025 01:35:06 +0000 (21:35 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-5.15/series
queue-5.15/xfs-allow-inode-inactivation-during-a-ro-mount-log-r.patch [new file with mode: 0644]

index 137c0b12ec8e39538443555fbb939b5ee325a6df..fd4c3fec36d90a0aa6b525bc7e10383033332622 100644 (file)
@@ -188,3 +188,4 @@ net-usb-aqc111-debug-info-before-sanitation.patch
 drm-meson-use-1000ull-when-operating-with-mode-clock.patch
 kbuild-userprogs-fix-bitsize-and-target-detection-on-clang.patch
 kbuild-hdrcheck-fix-cross-build-with-clang.patch
+xfs-allow-inode-inactivation-during-a-ro-mount-log-r.patch
diff --git a/queue-5.15/xfs-allow-inode-inactivation-during-a-ro-mount-log-r.patch b/queue-5.15/xfs-allow-inode-inactivation-during-a-ro-mount-log-r.patch
new file mode 100644 (file)
index 0000000..7d32a39
--- /dev/null
@@ -0,0 +1,74 @@
+From 47313bfbc4590710b2f965f9487d9658be459d0a Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 17 Jun 2025 22:55:33 +0200
+Subject: xfs: allow inode inactivation during a ro mount log recovery
+
+From: Darrick J. Wong <djwong@kernel.org>
+
+[ Upstream commit 76e589013fec672c3587d6314f2d1f0aeddc26d9 ]
+
+In the next patch, we're going to prohibit log recovery if the primary
+superblock contains an unrecognized rocompat feature bit even on
+readonly mounts.  This requires removing all the code in the log
+mounting process that temporarily disables the readonly state.
+
+Unfortunately, inode inactivation disables itself on readonly mounts.
+Clearing the iunlinked lists after log recovery needs inactivation to
+run to free the unreferenced inodes, which (AFAICT) is the only reason
+why log mounting plays games with the readonly state in the first place.
+
+Therefore, change the inactivation predicates to allow inactivation
+during log recovery of a readonly mount.
+
+Signed-off-by: Darrick J. Wong <djwong@kernel.org>
+Reviewed-by: Dave Chinner <dchinner@redhat.com>
+Stable-dep-of: 74ad4693b647 ("xfs: fix log recovery when unknown rocompat bits are set")
+Signed-off-by: Amir Goldstein <amir73il@gmail.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/xfs/xfs_inode.c | 15 +++++++++++----
+ 1 file changed, 11 insertions(+), 4 deletions(-)
+
+diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
+index 3b36d5569d15d..98955cd0de406 100644
+--- a/fs/xfs/xfs_inode.c
++++ b/fs/xfs/xfs_inode.c
+@@ -32,6 +32,7 @@
+ #include "xfs_symlink.h"
+ #include "xfs_trans_priv.h"
+ #include "xfs_log.h"
++#include "xfs_log_priv.h"
+ #include "xfs_bmap_btree.h"
+ #include "xfs_reflink.h"
+ #include "xfs_ag.h"
+@@ -1678,8 +1679,11 @@ xfs_inode_needs_inactive(
+       if (VFS_I(ip)->i_mode == 0)
+               return false;
+-      /* If this is a read-only mount, don't do this (would generate I/O) */
+-      if (xfs_is_readonly(mp))
++      /*
++       * If this is a read-only mount, don't do this (would generate I/O)
++       * unless we're in log recovery and cleaning the iunlinked list.
++       */
++      if (xfs_is_readonly(mp) && !xlog_recovery_needed(mp->m_log))
+               return false;
+       /* If the log isn't running, push inodes straight to reclaim. */
+@@ -1739,8 +1743,11 @@ xfs_inactive(
+       mp = ip->i_mount;
+       ASSERT(!xfs_iflags_test(ip, XFS_IRECOVERY));
+-      /* If this is a read-only mount, don't do this (would generate I/O) */
+-      if (xfs_is_readonly(mp))
++      /*
++       * If this is a read-only mount, don't do this (would generate I/O)
++       * unless we're in log recovery and cleaning the iunlinked list.
++       */
++      if (xfs_is_readonly(mp) && !xlog_recovery_needed(mp->m_log))
+               goto out;
+       /* Metadata inodes require explicit resource cleanup. */
+-- 
+2.39.5
+