From: Michael Maier <m1278468@allmail.net>
To: Eric Sandeen <sandeen@redhat.com>, xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH] xfs_repair: zero out unused parts of superblocks
Date: Thu, 15 Aug 2013 19:04:21 +0200 [thread overview]
Message-ID: <520D0A15.1050304@allmail.net> (raw)
In-Reply-To: <520C3C60.3090500@redhat.com>
Eric Sandeen wrote:
> Prior to:
> 1375cb65 xfs: growfs: don't read garbage for new secondary superblocks
>
> we ran the risk of allowing garbage in secondary superblocks
> beyond the in-use sb fields. With kernels 3.10 and beyond, the
> verifiers will kick these out as invalid, but xfs_repair does
> not detect or repair this condition.
>
> There is superblock stale-data zeroing code, but it is under a
> narrow conditional - the bug addressed in the above commit did not
> meet that conditional. So change this to check unconditionally.
>
> Further, the checking code was looking at the in-memory
> superblock buffer, which was zeroed prior to population, and
> would therefore never possibly show any stale data beyond the
> last up-rev superblock field.
>
> So instead, check the disk buffer for this garbage condition.
>
> If we detect garbage, we must zero out both the in-memory sb
> and the disk buffer; the former may contain unused data
> in up-rev sb fields which will be written back out; the latter
> may contain garbage beyond all fields, which won't be updated
> when we translate the in-memory sb back to disk.
>
> The V4 superblock case was zeroing out the sb_bad_features2
> field; we also fix that to leave that field alone.
>
> Lastly, use offsetof() instead of the tortured (__psint_t)
> casts & pointer math.
>
> Reported-by: Michael Maier <m1278468@allmail.net>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
>
> Michael - this will need slight tweaking to apply against
> older xfsprogs.
>
> Also:
>
> With more of Dave's changes, I think we can swap out:
>
> size = offsetof(xfs_sb_t, sb_lsn)
> + sizeof(sb->sb_lsn);
> for
> size = xfs_sb_info[XFS_SBS_LSN + 1].offset;
>
> but this version is a bit easier to backport, and works in the
> current git tree...
I tested with current git tree and it worked as expected for me!
Afterwards I was able to run xfs_growfs (from 3.1.11) w/o any problem.
Please excuse me - forgot to set the english locale before starting.
Hope you can guess what it should be in english :-).
Phase 1 - Superblock finden und überprüfen...
Schreiben verändert primären Superblock
Phase 2 - ein internes Protokoll benutzen
- Null-Protokoll...
- freier Speicher und Inode-Karten des Dateisystems werden
gescannt...
ungenutzten Anteil des »primär«-Superblocks nullen (AG #0)
primäre/sekundärer Superblock-1-Konflikt - AG-Superblock-Geometrie-Info
hat einen Konflikt mit der
Dateisystem-Geometrie
falscher sb für ag 1 wird zurückgesetzt
primäre/sekundärer Superblock-2-Konflikt - AG-Superblock-Geometrie-Info
hat einen Konflikt mit der
Dateisystem-Geometrie
falscher sb für ag 2 wird zurückgesetzt
primäre/sekundärer Superblock-3-Konflikt - AG-Superblock-Geometrie-Info
hat einen Konflikt mit der
Dateisystem-Geometrie
falscher sb für ag 3 wird zurückgesetzt
primäre/sekundärer Superblock-4-Konflikt - AG-Superblock-Geometrie-Info
hat einen Konflikt mit der
Dateisystem-Geometrie
falscher sb für ag 4 wird zurückgesetzt
primäre/sekundärer Superblock-5-Konflikt - AG-Superblock-Geometrie-Info
hat einen Konflikt mit der
Dateisystem-Geometrie
falscher sb für ag 5 wird zurückgesetzt
primäre/sekundärer Superblock-6-Konflikt - AG-Superblock-Geometrie-Info
hat einen Konflikt mit der
Dateisystem-Geometrie
falscher sb für ag 6 wird zurückgesetzt
primäre/sekundärer Superblock-7-Konflikt - AG-Superblock-Geometrie-Info
hat einen Konflikt mit der
Dateisystem-Geometrie
falscher sb für ag 7 wird zurückgesetzt
primäre/sekundärer Superblock-8-Konflikt - AG-Superblock-Geometrie-Info
hat einen Konflikt mit der
Dateisystem-Geometrie
falscher sb für ag 8 wird zurückgesetzt
primäre/sekundärer Superblock-9-Konflikt - AG-Superblock-Geometrie-Info
hat einen Konflikt mit der
Dateisystem-Geometrie
falscher sb für ag 9 wird zurückgesetzt
primäre/sekundärer Superblock-10-Konflikt - AG-Superblock-Geometrie-Info
hat einen Konflikt mit der
Dateisystem-Geometrie
falscher sb für ag 10 wird zurückgesetzt
primäre/sekundärer Superblock-11-Konflikt - AG-Superblock-Geometrie-Info
hat einen Konflikt mit der
Dateisystem-Geometrie
falscher sb für ag 11 wird zurückgesetzt
primäre/sekundärer Superblock-12-Konflikt - AG-Superblock-Geometrie-Info
hat einen Konflikt mit der
Dateisystem-Geometrie
falscher sb für ag 12 wird zurückgesetzt
primäre/sekundärer Superblock-13-Konflikt - AG-Superblock-Geometrie-Info
hat einen Konflikt mit der
Dateisystem-Geometrie
falscher sb für ag 13 wird zurückgesetzt
primäre/sekundärer Superblock-14-Konflikt - AG-Superblock-Geometrie-Info
hat einen Konflikt mit der
Dateisystem-Geometrie
falscher sb für ag 14 wird zurückgesetzt
primäre/sekundärer Superblock-15-Konflikt - AG-Superblock-Geometrie-Info
hat einen Konflikt mit der
Dateisystem-Geometrie
falscher sb für ag 15 wird zurückgesetzt
xfs_sb_read_verify: XFS_CORRUPTION_ERROR
ungenutzten Anteil des »sekundär«-Superblocks nullen (AG #16)
xfs_sb_read_verify: XFS_CORRUPTION_ERROR
ungenutzten Anteil des »sekundär«-Superblocks nullen (AG #17)
xfs_sb_read_verify: XFS_CORRUPTION_ERROR
ungenutzten Anteil des »sekundär«-Superblocks nullen (AG #18)
xfs_sb_read_verify: XFS_CORRUPTION_ERROR
ungenutzten Anteil des »sekundär«-Superblocks nullen (AG #19)
xfs_sb_read_verify: XFS_CORRUPTION_ERROR
ungenutzten Anteil des »sekundär«-Superblocks nullen (AG #20)
xfs_sb_read_verify: XFS_CORRUPTION_ERROR
ungenutzten Anteil des »sekundär«-Superblocks nullen (AG #21)
xfs_sb_read_verify: XFS_CORRUPTION_ERROR
ungenutzten Anteil des »sekundär«-Superblocks nullen (AG #22)
xfs_sb_read_verify: XFS_CORRUPTION_ERROR
ungenutzten Anteil des »sekundär«-Superblocks nullen (AG #23)
xfs_sb_read_verify: XFS_CORRUPTION_ERROR
ungenutzten Anteil des »sekundär«-Superblocks nullen (AG #24)
xfs_sb_read_verify: XFS_CORRUPTION_ERROR
ungenutzten Anteil des »sekundär«-Superblocks nullen (AG #25)
xfs_sb_read_verify: XFS_CORRUPTION_ERROR
ungenutzten Anteil des »sekundär«-Superblocks nullen (AG #26)
xfs_sb_read_verify: XFS_CORRUPTION_ERROR
ungenutzten Anteil des »sekundär«-Superblocks nullen (AG #27)
xfs_sb_read_verify: XFS_CORRUPTION_ERROR
ungenutzten Anteil des »sekundär«-Superblocks nullen (AG #28)
xfs_sb_read_verify: XFS_CORRUPTION_ERROR
ungenutzten Anteil des »sekundär«-Superblocks nullen (AG #29)
invalid start block 4096000 in record 1 of bno btree block 41/1
invalid start block 4096000 in record 1 of cnt btree block 41/2
agf_freeblks 3604481, gezählt 1 in ag 41
agf_longest 3604480, gezählt 1 in ag 41
sb_icount 0, counted 6528
sb_ifree 0, counted 669
sb_fdblocks 0, counted 80515
- Wurzel-Inode-Stück gefunden
Phase 3 - für jedes AG...
- agi unverknüpfte Listen werden gescannt und bereinigt...
- bekannte Inodes werden behandelt und Inode-Entdeckung wird
durchgeführt...
- agno = 0
- agno = 1
- agno = 2
- agno = 3
- agno = 4
- agno = 5
- agno = 6
- agno = 7
- agno = 8
- agno = 9
- agno = 10
- agno = 11
- agno = 12
- agno = 13
- agno = 14
- agno = 15
- agno = 16
- agno = 17
- agno = 18
- agno = 19
- agno = 20
- agno = 21
- agno = 22
- agno = 23
- agno = 24
- agno = 25
- agno = 26
- agno = 27
- agno = 28
- agno = 29
- agno = 30
- agno = 31
- agno = 32
- agno = 33
- agno = 34
- agno = 35
- agno = 36
- agno = 37
- agno = 38
- agno = 39
- agno = 40
- agno = 41
- neu entdeckte Inodes werden behandelt...
Phase 4 - auf doppelte Blöcke überprüfen...
- Liste mit doppeltem Ausmaß wird eingerichtet...
- es wird geprüft ob Inodes Blocks doppelt beanspruchen...
- agno = 0
- agno = 2
- agno = 1
- agno = 4
- agno = 3
- agno = 6
- agno = 7
- agno = 5
- agno = 8
- agno = 9
- agno = 10
- agno = 11
- agno = 12
- agno = 13
- agno = 14
- agno = 15
- agno = 16
- agno = 17
- agno = 18
- agno = 19
- agno = 20
- agno = 21
- agno = 22
- agno = 23
- agno = 24
- agno = 25
- agno = 26
- agno = 27
- agno = 29
- agno = 30
- agno = 28
- agno = 31
- agno = 33
- agno = 32
- agno = 34
- agno = 35
- agno = 36
- agno = 38
- agno = 37
- agno = 40
- agno = 39
- agno = 41
Phase 5 - AG-Köpfe und Bäume werden erneut gebildet...
- Superblock wird zurückgesetzt...
Phase 6 - Inode-Verbindbarkeit wird geprüft...
- Inhalte der Echtzeit-Bitmaps und Zusammenfassungs-Inodes
werden zurückgesetzt
- Dateisystem wird durchquert ...
- durchqueren beendet ...
- nicht verbundene Inodes werden nach lost+found verschoben ...
Phase 7 - Verweisanzahl wird geprüft und berichtigt...
erledigt
Thanks,
kind regards,
Michael
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2013-08-15 17:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-15 2:26 [PATCH] xfs_repair: zero out unused parts of superblocks Eric Sandeen
2013-08-15 17:04 ` Michael Maier [this message]
2013-08-16 15:05 ` Eric Sandeen
2013-08-27 17:47 ` Rich Johnston
2013-08-27 17:57 ` Rich Johnston
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=520D0A15.1050304@allmail.net \
--to=m1278468@allmail.net \
--cc=sandeen@redhat.com \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.