public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET 0/3] xfs: fix ro mounting with unknown rocompat features
@ 2023-08-24 23:21 Darrick J. Wong
  2023-08-24 23:21 ` [PATCH 1/3] xfs: allow inode inactivation during a ro mount log recovery Darrick J. Wong
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Darrick J. Wong @ 2023-08-24 23:21 UTC (permalink / raw)
  To: chandan.babu, djwong; +Cc: linux-xfs, david, sandeen

Hi all,

Dave pointed out some failures in xfs/270 when he upgraded Debian
unstable and util-linux started using the new mount apis.  Upon further
inquiry I noticed that XFS is quite a hot mess when it encounters a
filesystem with unrecognized rocompat bits set in the superblock.

Whereas we used to allow readonly mounts under these conditions, a
change to the sb write verifier several years ago resulted in the
filesystem going down immediately because the post-mount log cleaning
writes the superblock, which trips the sb write verifier on the
unrecognized rocompat bit.  I made the observation that the ROCOMPAT
features RMAPBT and REFLINK both protect new log intent item types,
which means that we actually cannot support recovering the log if we
don't recognize all the rocompat bits.

Therefore -- fix inode inactivation to work when we're recovering the
log, disallow recovery when there's unrecognized rocompat bits, and
don't clean the log if doing so would trip the rocompat checks.

If you're going to start using this code, I strongly recommend pulling
from my git trees, which are linked below.

This has been lightly tested with fstests.  Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=fix-ro-mounts-6.6
---
 fs/xfs/xfs_inode.c       |   14 ++++++++++----
 fs/xfs/xfs_log.c         |   23 ++++++-----------------
 fs/xfs/xfs_log_priv.h    |    7 +++++++
 fs/xfs/xfs_log_recover.c |   32 ++++++++++++++++++++++++++++++++
 4 files changed, 55 insertions(+), 21 deletions(-)


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-08-29  3:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-24 23:21 [PATCHSET 0/3] xfs: fix ro mounting with unknown rocompat features Darrick J. Wong
2023-08-24 23:21 ` [PATCH 1/3] xfs: allow inode inactivation during a ro mount log recovery Darrick J. Wong
2023-08-24 23:21 ` [PATCH 2/3] xfs: don't allow log recovery when unknown rocompat bits are set Darrick J. Wong
2023-08-25  1:07   ` Dave Chinner
2023-08-25  4:04     ` Darrick J. Wong
2023-08-28 19:08       ` Darrick J. Wong
2023-08-28 21:47         ` Dave Chinner
2023-08-29  3:10           ` Darrick J. Wong
2023-08-24 23:21 ` [PATCH 3/3] xfs: log is not writable if we have unknown rocompat features Darrick J. Wong
2023-08-25  1:08   ` Dave Chinner
2023-08-24 23:27 ` [PATCH 4/3] xfs/270: actually test file readability Darrick J. Wong
2023-08-24 23:28 ` [PATCH 5/3] xfs/270: actually test log recovery with unknown rocompat features Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox