From: Rich Johnston <rjohnston@sgi.com>
To: Eric Sandeen <sandeen@redhat.com>
Cc: Michael Maier <m1278468@allmail.net>, xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH] xfs_repair: zero out unused parts of superblocks
Date: Tue, 27 Aug 2013 12:47:10 -0500 [thread overview]
Message-ID: <521CE61E.2010606@sgi.com> (raw)
In-Reply-To: <520E3FBF.7070708@redhat.com>
On 08/16/2013 10:05 AM, Eric Sandeen wrote:
> On 8/15/13 12:04 PM, Michael Maier wrote:
>> 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 :-).
>>
>
> Kein Problem, ich kann etwas Deutsch zu lesen. :)
Ich auch :)
Code looks good.
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
>
> Glad it worked for you!
>
> -Eric
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2013-08-27 17:46 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
2013-08-16 15:05 ` Eric Sandeen
2013-08-27 17:47 ` Rich Johnston [this message]
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=521CE61E.2010606@sgi.com \
--to=rjohnston@sgi.com \
--cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox