* [PATCH] xfs: remove unknown compat feature check in superblock write validation
@ 2024-10-21 1:25 Long Li
2024-11-09 7:38 ` Long Li
0 siblings, 1 reply; 4+ messages in thread
From: Long Li @ 2024-10-21 1:25 UTC (permalink / raw)
To: djwong, cem; +Cc: linux-xfs, david, yi.zhang, houtao1, leo.lilong, yangerkun
Compat features are new features that older kernels can safely ignore,
allowing read-write mounts without issues. The current sb write validation
implementation returns -EFSCORRUPTED for unknown compat features,
preventing filesystem write operations and contradicting the feature's
definition.
Additionally, if the mounted image is unclean, the log recovery may need
to write to the superblock. Returning an error for unknown compat features
during sb write validation can cause mount failures.
Although XFS currently does not use compat feature flags, this issue
affects current kernels' ability to mount images that may use compat
feature flags in the future.
Since superblock read validation already warns about unknown compat
features, it's unnecessary to repeat this warning during write validation.
Therefore, the relevant code in write validation is being removed.
Fixes: 9e037cb7972f ("xfs: check for unknown v5 feature bits in superblock write verifier")
Signed-off-by: Long Li <leo.lilong@huawei.com>
---
fs/xfs/libxfs/xfs_sb.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c
index d95409f3cba6..02ebcbc4882f 100644
--- a/fs/xfs/libxfs/xfs_sb.c
+++ b/fs/xfs/libxfs/xfs_sb.c
@@ -297,13 +297,6 @@ xfs_validate_sb_write(
* the kernel cannot support since we checked for unsupported bits in
* the read verifier, which means that memory is corrupt.
*/
- if (xfs_sb_has_compat_feature(sbp, XFS_SB_FEAT_COMPAT_UNKNOWN)) {
- xfs_warn(mp,
-"Corruption detected in superblock compatible features (0x%x)!",
- (sbp->sb_features_compat & XFS_SB_FEAT_COMPAT_UNKNOWN));
- return -EFSCORRUPTED;
- }
-
if (!xfs_is_readonly(mp) &&
xfs_sb_has_ro_compat_feature(sbp, XFS_SB_FEAT_RO_COMPAT_UNKNOWN)) {
xfs_alert(mp,
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] xfs: remove unknown compat feature check in superblock write validation
2024-10-21 1:25 [PATCH] xfs: remove unknown compat feature check in superblock write validation Long Li
@ 2024-11-09 7:38 ` Long Li
2024-11-09 16:21 ` Darrick J. Wong
0 siblings, 1 reply; 4+ messages in thread
From: Long Li @ 2024-11-09 7:38 UTC (permalink / raw)
To: djwong, cem; +Cc: linux-xfs, david, yi.zhang, houtao1, yangerkun
Friendly Ping ...
On Mon, Oct 21, 2024 at 09:25:49AM +0800, Long Li wrote:
> Compat features are new features that older kernels can safely ignore,
> allowing read-write mounts without issues. The current sb write validation
> implementation returns -EFSCORRUPTED for unknown compat features,
> preventing filesystem write operations and contradicting the feature's
> definition.
>
> Additionally, if the mounted image is unclean, the log recovery may need
> to write to the superblock. Returning an error for unknown compat features
> during sb write validation can cause mount failures.
>
> Although XFS currently does not use compat feature flags, this issue
> affects current kernels' ability to mount images that may use compat
> feature flags in the future.
>
> Since superblock read validation already warns about unknown compat
> features, it's unnecessary to repeat this warning during write validation.
> Therefore, the relevant code in write validation is being removed.
>
> Fixes: 9e037cb7972f ("xfs: check for unknown v5 feature bits in superblock write verifier")
> Signed-off-by: Long Li <leo.lilong@huawei.com>
> ---
> fs/xfs/libxfs/xfs_sb.c | 7 -------
> 1 file changed, 7 deletions(-)
>
> diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c
> index d95409f3cba6..02ebcbc4882f 100644
> --- a/fs/xfs/libxfs/xfs_sb.c
> +++ b/fs/xfs/libxfs/xfs_sb.c
> @@ -297,13 +297,6 @@ xfs_validate_sb_write(
> * the kernel cannot support since we checked for unsupported bits in
> * the read verifier, which means that memory is corrupt.
> */
> - if (xfs_sb_has_compat_feature(sbp, XFS_SB_FEAT_COMPAT_UNKNOWN)) {
> - xfs_warn(mp,
> -"Corruption detected in superblock compatible features (0x%x)!",
> - (sbp->sb_features_compat & XFS_SB_FEAT_COMPAT_UNKNOWN));
> - return -EFSCORRUPTED;
> - }
> -
> if (!xfs_is_readonly(mp) &&
> xfs_sb_has_ro_compat_feature(sbp, XFS_SB_FEAT_RO_COMPAT_UNKNOWN)) {
> xfs_alert(mp,
> --
> 2.39.2
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] xfs: remove unknown compat feature check in superblock write validation
2024-11-09 7:38 ` Long Li
@ 2024-11-09 16:21 ` Darrick J. Wong
2024-11-11 2:14 ` Long Li
0 siblings, 1 reply; 4+ messages in thread
From: Darrick J. Wong @ 2024-11-09 16:21 UTC (permalink / raw)
To: Long Li; +Cc: cem, linux-xfs, david, yi.zhang, houtao1, yangerkun
On Sat, Nov 09, 2024 at 03:38:55PM +0800, Long Li wrote:
>
> Friendly Ping ...
Sorry about that, I missed this one.
> On Mon, Oct 21, 2024 at 09:25:49AM +0800, Long Li wrote:
> > Compat features are new features that older kernels can safely ignore,
> > allowing read-write mounts without issues. The current sb write validation
> > implementation returns -EFSCORRUPTED for unknown compat features,
> > preventing filesystem write operations and contradicting the feature's
> > definition.
> >
> > Additionally, if the mounted image is unclean, the log recovery may need
> > to write to the superblock. Returning an error for unknown compat features
> > during sb write validation can cause mount failures.
> >
> > Although XFS currently does not use compat feature flags, this issue
> > affects current kernels' ability to mount images that may use compat
> > feature flags in the future.
> >
> > Since superblock read validation already warns about unknown compat
> > features, it's unnecessary to repeat this warning during write validation.
> > Therefore, the relevant code in write validation is being removed.
> >
You might want to add this so it actually gets backported:
Cc: <stable@vger.kernel.org> # v4.19
> > Fixes: 9e037cb7972f ("xfs: check for unknown v5 feature bits in superblock write verifier")
> > Signed-off-by: Long Li <leo.lilong@huawei.com>
Makes sense, so
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
--D
> > ---
> > fs/xfs/libxfs/xfs_sb.c | 7 -------
> > 1 file changed, 7 deletions(-)
> >
> > diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c
> > index d95409f3cba6..02ebcbc4882f 100644
> > --- a/fs/xfs/libxfs/xfs_sb.c
> > +++ b/fs/xfs/libxfs/xfs_sb.c
> > @@ -297,13 +297,6 @@ xfs_validate_sb_write(
> > * the kernel cannot support since we checked for unsupported bits in
> > * the read verifier, which means that memory is corrupt.
> > */
> > - if (xfs_sb_has_compat_feature(sbp, XFS_SB_FEAT_COMPAT_UNKNOWN)) {
> > - xfs_warn(mp,
> > -"Corruption detected in superblock compatible features (0x%x)!",
> > - (sbp->sb_features_compat & XFS_SB_FEAT_COMPAT_UNKNOWN));
> > - return -EFSCORRUPTED;
> > - }
> > -
> > if (!xfs_is_readonly(mp) &&
> > xfs_sb_has_ro_compat_feature(sbp, XFS_SB_FEAT_RO_COMPAT_UNKNOWN)) {
> > xfs_alert(mp,
> > --
> > 2.39.2
> >
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] xfs: remove unknown compat feature check in superblock write validation
2024-11-09 16:21 ` Darrick J. Wong
@ 2024-11-11 2:14 ` Long Li
0 siblings, 0 replies; 4+ messages in thread
From: Long Li @ 2024-11-11 2:14 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: cem, linux-xfs, david, yi.zhang, houtao1, yangerkun
On Sat, Nov 09, 2024 at 08:21:24AM -0800, Darrick J. Wong wrote:
> On Sat, Nov 09, 2024 at 03:38:55PM +0800, Long Li wrote:
> >
> > Friendly Ping ...
>
> Sorry about that, I missed this one.
>
> > On Mon, Oct 21, 2024 at 09:25:49AM +0800, Long Li wrote:
> > > Compat features are new features that older kernels can safely ignore,
> > > allowing read-write mounts without issues. The current sb write validation
> > > implementation returns -EFSCORRUPTED for unknown compat features,
> > > preventing filesystem write operations and contradicting the feature's
> > > definition.
> > >
> > > Additionally, if the mounted image is unclean, the log recovery may need
> > > to write to the superblock. Returning an error for unknown compat features
> > > during sb write validation can cause mount failures.
> > >
> > > Although XFS currently does not use compat feature flags, this issue
> > > affects current kernels' ability to mount images that may use compat
> > > feature flags in the future.
> > >
> > > Since superblock read validation already warns about unknown compat
> > > features, it's unnecessary to repeat this warning during write validation.
> > > Therefore, the relevant code in write validation is being removed.
> > >
>
> You might want to add this so it actually gets backported:
>
> Cc: <stable@vger.kernel.org> # v4.19
>
Thanks for your review, indeed, it should backport to v4.19+.
> > > Fixes: 9e037cb7972f ("xfs: check for unknown v5 feature bits in superblock write verifier")
> > > Signed-off-by: Long Li <leo.lilong@huawei.com>
>
> Makes sense, so
> Reviewed-by: Darrick J. Wong <djwong@kernel.org>
>
> --D
>
> > > ---
> > > fs/xfs/libxfs/xfs_sb.c | 7 -------
> > > 1 file changed, 7 deletions(-)
> > >
> > > diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c
> > > index d95409f3cba6..02ebcbc4882f 100644
> > > --- a/fs/xfs/libxfs/xfs_sb.c
> > > +++ b/fs/xfs/libxfs/xfs_sb.c
> > > @@ -297,13 +297,6 @@ xfs_validate_sb_write(
> > > * the kernel cannot support since we checked for unsupported bits in
> > > * the read verifier, which means that memory is corrupt.
> > > */
> > > - if (xfs_sb_has_compat_feature(sbp, XFS_SB_FEAT_COMPAT_UNKNOWN)) {
> > > - xfs_warn(mp,
> > > -"Corruption detected in superblock compatible features (0x%x)!",
> > > - (sbp->sb_features_compat & XFS_SB_FEAT_COMPAT_UNKNOWN));
> > > - return -EFSCORRUPTED;
> > > - }
> > > -
> > > if (!xfs_is_readonly(mp) &&
> > > xfs_sb_has_ro_compat_feature(sbp, XFS_SB_FEAT_RO_COMPAT_UNKNOWN)) {
> > > xfs_alert(mp,
> > > --
> > > 2.39.2
> > >
> >
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-11-11 2:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-21 1:25 [PATCH] xfs: remove unknown compat feature check in superblock write validation Long Li
2024-11-09 7:38 ` Long Li
2024-11-09 16:21 ` Darrick J. Wong
2024-11-11 2:14 ` Long Li
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox