xfs
[Top] [All Lists]

Re: Enabling lazy counters damages filesystem

To: Marcin Miros?aw <marcin@xxxxxxxx>
Subject: Re: Enabling lazy counters damages filesystem
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Wed, 28 Apr 2010 16:40:08 -0500
Cc: xfs@xxxxxxxxxxx
In-reply-to: <4BD84771.4030804@xxxxxxxx>
References: <4BD84771.4030804@xxxxxxxx>
User-agent: Thunderbird 2.0.0.24 (Macintosh/20100228)
Marcin Miros?aw wrote:
> Hello,
> Please look at this:
> # mkfs.xfs -f /dev/malowazne/test
> meta-data=/dev/malowazne/test    isize=256    agcount=4, agsize=524288 blks
>          =                       sectsz=512   attr=2
> data     =                       bsize=4096   blocks=2097152, imaxpct=25
>          =                       sunit=0      swidth=0 blks
> naming   =version 2              bsize=4096   ascii-ci=0
> log      =internal log           bsize=4096   blocks=2560, version=2
>          =                       sectsz=512   sunit=0 blks, lazy-count=0
> realtime =none                   extsz=4096   blocks=0, rtextents=0
> 
> # xfs_check /dev/malowazne/test
> # xfs_check /dev/malowazne/test
> 
> It's still clean.
> 
> # xfs_admin -c 1 /dev/malowazne/test
> Enabling lazy-counters
> # xfs_check /dev/malowazne/test
> sb_features2 (0xa) not same as sb_bad_features2 (0x8)

ok, I guess that mechanism is not hitting both sb fields.

Should be a trivial fix, something like below.

-Eric

diff --git a/repair/phase1.c b/repair/phase1.c
index 618796e..dbfbc9b 100644
--- a/repair/phase1.c
+++ b/repair/phase1.c
@@ -117,11 +117,13 @@ phase1(xfs_mount_t *mp)
                if (lazy_count && !xfs_sb_version_haslazysbcount(sb)) {
                        sb->sb_versionnum |= XFS_SB_VERSION_MOREBITSBIT;
                        sb->sb_features2 |= XFS_SB_VERSION2_LAZYSBCOUNTBIT;
+                       sb->sb_bad_features2 |= XFS_SB_VERSION2_LAZYSBCOUNTBIT;
                        primary_sb_modified = 1;
                        printf(_("Enabling lazy-counters\n"));
                } else
                if (!lazy_count && xfs_sb_version_haslazysbcount(sb)) {
                        sb->sb_features2 &= ~XFS_SB_VERSION2_LAZYSBCOUNTBIT;
+                       sb->sb_bad_features2 &= ~XFS_SB_VERSION2_LAZYSBCOUNTBIT;
                        printf(_("Disabling lazy-counters\n"));
                        primary_sb_modified = 1;
                } else {

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