xfs
[Top] [All Lists]

Re: [patch] detect and correct bad features2 superblock field

To: David Chinner <dgc@xxxxxxx>
Subject: Re: [patch] detect and correct bad features2 superblock field
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Sat, 29 Mar 2008 20:49:12 -0500
Cc: xfs-dev <xfs-dev@xxxxxxx>, xfs-oss <xfs@xxxxxxxxxxx>
In-reply-to: <47EEED18.9090206@xxxxxxxxxxx>
References: <20080220054041.GM155407@xxxxxxx> <47EEED18.9090206@xxxxxxxxxxx>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Thunderbird 2.0.0.12 (Macintosh/20080213)
Eric Sandeen wrote:

> Hm, the other problem here may be that if we zero bad_features2, then
> any older kernel will mount up as attr2... and run into the corruption
> problem I found on F8...
>   
Er, as attr1

> Should we make features2 and bad_features2 match rather than zeroing
> bad_features2?
>   
Maybe like this...?  Though I suppose there's still a minor issue
with older tools modifying flags...

diff -u linux-2.6.24.x86_64/fs/xfs/xfs_sb.h linux-2.6.24.x86_64/fs/xfs/xfs_sb.h
--- linux-2.6.24.x86_64/fs/xfs/xfs_sb.h
+++ linux-2.6.24.x86_64/fs/xfs/xfs_sb.h
@@ -325,7 +325,7 @@
  */
 static inline int xfs_sb_has_bad_features2(xfs_sb_t *sbp)
 {
-       return (sbp->sb_bad_features2 != 0);
+       return (sbp->sb_features2 != sbp->sb_bad_features2);
 }
 
 #define        XFS_SB_VERSION_TONEW(v) xfs_sb_version_tonew(v)
diff -u linux-2.6.24.x86_64/fs/xfs/xfs_mount.c 
linux-2.6.24.x86_64/fs/xfs/xfs_mount.c
--- linux-2.6.24.x86_64/fs/xfs/xfs_mount.c
+++ linux-2.6.24.x86_64/fs/xfs/xfs_mount.c
@@ -994,7 +994,7 @@
                cmn_err(CE_WARN,
                        "XFS: correcting sb_features alignment problem");
                sbp->sb_features2 |= sbp->sb_bad_features2;
-               sbp->sb_bad_features2 = 0;
+               sbp->sb_bad_features2 = sbp->sb_features2;
                update_flags |= XFS_SB_FEATURES2 | XFS_SB_BAD_FEATURES2;
        }
 


<Prev in Thread] Current Thread [Next in Thread>