linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHSET v2 0/1] fstests: fix ro mounting with unknown rocompat features
@ 2023-09-25 21:42 Darrick J. Wong
  2023-09-25 21:42 ` [PATCH 1/1] xfs/270: update commit id for _fixed_by tag Darrick J. Wong
  0 siblings, 1 reply; 6+ messages in thread
From: Darrick J. Wong @ 2023-09-25 21:42 UTC (permalink / raw)
  To: djwong, zlang; +Cc: linux-xfs, fstests, guan, 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.

v2: change direction of series to allow log recovery on ro mounts

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

This has been running on the djcloud for months with no problems.  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

fstests git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfstests-dev.git/log/?h=fix-ro-mounts
---
 tests/xfs/270 |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


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

* [PATCH 1/1] xfs/270: update commit id for _fixed_by tag.
  2023-09-25 21:42 [PATCHSET v2 0/1] fstests: fix ro mounting with unknown rocompat features Darrick J. Wong
@ 2023-09-25 21:42 ` Darrick J. Wong
  2023-09-29  5:22   ` Zorro Lang
  2023-09-29 17:28   ` [PATCH v2.1 1/1] xfs/{270,557,600}: " Darrick J. Wong
  0 siblings, 2 replies; 6+ messages in thread
From: Darrick J. Wong @ 2023-09-25 21:42 UTC (permalink / raw)
  To: djwong, zlang; +Cc: linux-xfs, fstests, guan, david, sandeen

From: Darrick J. Wong <djwong@kernel.org>

Update the commit id in the _fixed_by tag now that we've merged the
kernel fix.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 tests/xfs/270 |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


diff --git a/tests/xfs/270 b/tests/xfs/270
index 7d4e1f6a87..4e4f767dc1 100755
--- a/tests/xfs/270
+++ b/tests/xfs/270
@@ -17,7 +17,7 @@ _begin_fstest auto quick mount
 
 # real QA test starts here
 _supported_fs xfs
-_fixed_by_kernel_commit xxxxxxxxxxxx \
+_fixed_by_kernel_commit 74ad4693b647 \
 	"xfs: fix log recovery when unknown rocompat bits are set"
 # skip fs check because superblock contains unknown ro-compat features
 _require_scratch_nocheck


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

* Re: [PATCH 1/1] xfs/270: update commit id for _fixed_by tag.
  2023-09-25 21:42 ` [PATCH 1/1] xfs/270: update commit id for _fixed_by tag Darrick J. Wong
@ 2023-09-29  5:22   ` Zorro Lang
  2023-09-29 17:27     ` Darrick J. Wong
  2023-09-29 17:28   ` [PATCH v2.1 1/1] xfs/{270,557,600}: " Darrick J. Wong
  1 sibling, 1 reply; 6+ messages in thread
From: Zorro Lang @ 2023-09-29  5:22 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs, fstests

On Mon, Sep 25, 2023 at 02:42:56PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Update the commit id in the _fixed_by tag now that we've merged the
> kernel fix.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
>  tests/xfs/270 |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 
> diff --git a/tests/xfs/270 b/tests/xfs/270
> index 7d4e1f6a87..4e4f767dc1 100755
> --- a/tests/xfs/270
> +++ b/tests/xfs/270
> @@ -17,7 +17,7 @@ _begin_fstest auto quick mount
>  
>  # real QA test starts here
>  _supported_fs xfs
> -_fixed_by_kernel_commit xxxxxxxxxxxx \
> +_fixed_by_kernel_commit 74ad4693b647 \
>  	"xfs: fix log recovery when unknown rocompat bits are set"

This patch is good to me, but we have more xfs cases have fixed commit which
have been merged:

$ grep -rsni xxxxxxxx tests/xfs|grep _fixed
tests/xfs/600:23:_fixed_by_git_commit kernel XXXXXXXXXXXXX \
tests/xfs/557:21:_fixed_by_kernel_commit XXXXXXXXXXXX \
tests/xfs/270:20:_fixed_by_kernel_commit xxxxxxxxxxxx \

xfs/600: cfa2df68b7ce xfs: fix an agbno overflow in __xfs_getfsmap_datadev
xfs/557: 817644fa4525 xfs: get root inode correctly at bulkstat

Do you want to fix them in one patch, or you hope to merge this
patch at first?

Thanks,
Zorro


>  # skip fs check because superblock contains unknown ro-compat features
>  _require_scratch_nocheck
> 


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

* Re: [PATCH 1/1] xfs/270: update commit id for _fixed_by tag.
  2023-09-29  5:22   ` Zorro Lang
@ 2023-09-29 17:27     ` Darrick J. Wong
  0 siblings, 0 replies; 6+ messages in thread
From: Darrick J. Wong @ 2023-09-29 17:27 UTC (permalink / raw)
  To: Zorro Lang; +Cc: linux-xfs, fstests

On Fri, Sep 29, 2023 at 01:22:59PM +0800, Zorro Lang wrote:
> On Mon, Sep 25, 2023 at 02:42:56PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> > 
> > Update the commit id in the _fixed_by tag now that we've merged the
> > kernel fix.
> > 
> > Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> > ---
> >  tests/xfs/270 |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > 
> > diff --git a/tests/xfs/270 b/tests/xfs/270
> > index 7d4e1f6a87..4e4f767dc1 100755
> > --- a/tests/xfs/270
> > +++ b/tests/xfs/270
> > @@ -17,7 +17,7 @@ _begin_fstest auto quick mount
> >  
> >  # real QA test starts here
> >  _supported_fs xfs
> > -_fixed_by_kernel_commit xxxxxxxxxxxx \
> > +_fixed_by_kernel_commit 74ad4693b647 \
> >  	"xfs: fix log recovery when unknown rocompat bits are set"
> 
> This patch is good to me, but we have more xfs cases have fixed commit which
> have been merged:
> 
> $ grep -rsni xxxxxxxx tests/xfs|grep _fixed
> tests/xfs/600:23:_fixed_by_git_commit kernel XXXXXXXXXXXXX \
> tests/xfs/557:21:_fixed_by_kernel_commit XXXXXXXXXXXX \
> tests/xfs/270:20:_fixed_by_kernel_commit xxxxxxxxxxxx \
> 
> xfs/600: cfa2df68b7ce xfs: fix an agbno overflow in __xfs_getfsmap_datadev
> xfs/557: 817644fa4525 xfs: get root inode correctly at bulkstat
> 
> Do you want to fix them in one patch, or you hope to merge this
> patch at first?

Eh, I'll just resubmit with all three.

--D

> Thanks,
> Zorro
> 
> 
> >  # skip fs check because superblock contains unknown ro-compat features
> >  _require_scratch_nocheck
> > 
> 

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

* [PATCH v2.1 1/1] xfs/{270,557,600}: update commit id for _fixed_by tag.
  2023-09-25 21:42 ` [PATCH 1/1] xfs/270: update commit id for _fixed_by tag Darrick J. Wong
  2023-09-29  5:22   ` Zorro Lang
@ 2023-09-29 17:28   ` Darrick J. Wong
  2023-10-01 11:51     ` Zorro Lang
  1 sibling, 1 reply; 6+ messages in thread
From: Darrick J. Wong @ 2023-09-29 17:28 UTC (permalink / raw)
  To: zlang; +Cc: linux-xfs, fstests, guan, david, sandeen

From: Darrick J. Wong <djwong@kernel.org>

Update the commit id in the _fixed_by tag now that we've merged the
kernel fixes.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 tests/xfs/270 |    2 +-
 tests/xfs/557 |    2 +-
 tests/xfs/600 |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/xfs/270 b/tests/xfs/270
index 7d4e1f6a87..4e4f767dc1 100755
--- a/tests/xfs/270
+++ b/tests/xfs/270
@@ -17,7 +17,7 @@ _begin_fstest auto quick mount
 
 # real QA test starts here
 _supported_fs xfs
-_fixed_by_kernel_commit xxxxxxxxxxxx \
+_fixed_by_kernel_commit 74ad4693b647 \
 	"xfs: fix log recovery when unknown rocompat bits are set"
 # skip fs check because superblock contains unknown ro-compat features
 _require_scratch_nocheck
diff --git a/tests/xfs/557 b/tests/xfs/557
index 522c4f0643..01205377b7 100644
--- a/tests/xfs/557
+++ b/tests/xfs/557
@@ -18,7 +18,7 @@ _require_xfs_io_command "falloc"
 _require_xfs_io_command "bulkstat_single"
 _require_scratch
 
-_fixed_by_kernel_commit XXXXXXXXXXXX \
+_fixed_by_kernel_commit 817644fa4525 \
 	"xfs: get root inode correctly at bulkstat"
 
 # Create a filesystem which contains a fake root inode
diff --git a/tests/xfs/600 b/tests/xfs/600
index 56af634a7c..e6997c53d1 100755
--- a/tests/xfs/600
+++ b/tests/xfs/600
@@ -20,7 +20,7 @@ _begin_fstest auto quick fsmap
 
 . ./common/filter
 
-_fixed_by_git_commit kernel XXXXXXXXXXXXX \
+_fixed_by_git_commit kernel cfa2df68b7ce \
 	"xfs: fix an agbno overflow in __xfs_getfsmap_datadev"
 
 # Modify as appropriate.

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

* Re: [PATCH v2.1 1/1] xfs/{270,557,600}: update commit id for _fixed_by tag.
  2023-09-29 17:28   ` [PATCH v2.1 1/1] xfs/{270,557,600}: " Darrick J. Wong
@ 2023-10-01 11:51     ` Zorro Lang
  0 siblings, 0 replies; 6+ messages in thread
From: Zorro Lang @ 2023-10-01 11:51 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs, fstests

On Fri, Sep 29, 2023 at 10:28:01AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Update the commit id in the _fixed_by tag now that we've merged the
> kernel fixes.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---

Thanks, this version is good to me.

Reviewed-by: Zorro Lang <zlang@redhat.com>

>  tests/xfs/270 |    2 +-
>  tests/xfs/557 |    2 +-
>  tests/xfs/600 |    2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/xfs/270 b/tests/xfs/270
> index 7d4e1f6a87..4e4f767dc1 100755
> --- a/tests/xfs/270
> +++ b/tests/xfs/270
> @@ -17,7 +17,7 @@ _begin_fstest auto quick mount
>  
>  # real QA test starts here
>  _supported_fs xfs
> -_fixed_by_kernel_commit xxxxxxxxxxxx \
> +_fixed_by_kernel_commit 74ad4693b647 \
>  	"xfs: fix log recovery when unknown rocompat bits are set"
>  # skip fs check because superblock contains unknown ro-compat features
>  _require_scratch_nocheck
> diff --git a/tests/xfs/557 b/tests/xfs/557
> index 522c4f0643..01205377b7 100644
> --- a/tests/xfs/557
> +++ b/tests/xfs/557
> @@ -18,7 +18,7 @@ _require_xfs_io_command "falloc"
>  _require_xfs_io_command "bulkstat_single"
>  _require_scratch
>  
> -_fixed_by_kernel_commit XXXXXXXXXXXX \
> +_fixed_by_kernel_commit 817644fa4525 \
>  	"xfs: get root inode correctly at bulkstat"
>  
>  # Create a filesystem which contains a fake root inode
> diff --git a/tests/xfs/600 b/tests/xfs/600
> index 56af634a7c..e6997c53d1 100755
> --- a/tests/xfs/600
> +++ b/tests/xfs/600
> @@ -20,7 +20,7 @@ _begin_fstest auto quick fsmap
>  
>  . ./common/filter
>  
> -_fixed_by_git_commit kernel XXXXXXXXXXXXX \
> +_fixed_by_git_commit kernel cfa2df68b7ce \
>  	"xfs: fix an agbno overflow in __xfs_getfsmap_datadev"
>  
>  # Modify as appropriate.
> 


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

end of thread, other threads:[~2023-10-01 11:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-25 21:42 [PATCHSET v2 0/1] fstests: fix ro mounting with unknown rocompat features Darrick J. Wong
2023-09-25 21:42 ` [PATCH 1/1] xfs/270: update commit id for _fixed_by tag Darrick J. Wong
2023-09-29  5:22   ` Zorro Lang
2023-09-29 17:27     ` Darrick J. Wong
2023-09-29 17:28   ` [PATCH v2.1 1/1] xfs/{270,557,600}: " Darrick J. Wong
2023-10-01 11:51     ` Zorro Lang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).