All of lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@bugzilla.kernel.org
To: linux-ext4@vger.kernel.org
Subject: [Bug 23772] oops after mounting ext4 fs in 2.6.36.1 (failed to parse options in superblock)
Date: Mon, 29 Nov 2010 21:55:04 GMT	[thread overview]
Message-ID: <201011292155.oATLt4vX027018@demeter2.kernel.org> (raw)
In-Reply-To: <bug-23772-13602@https.bugzilla.kernel.org/>

https://bugzilla.kernel.org/show_bug.cgi?id=23772


Andreas Dilger <adilger.kernelbugzilla@dilger.ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |adilger.kernelbugzilla@dilg
                   |                            |er.ca




--- Comment #14 from Andreas Dilger <adilger.kernelbugzilla@dilger.ca>  2010-11-29 21:55:03 ---
(In reply to comment #10)
> Well, one question is how did the stale data get put there in the first place? 
> The entire superblock is zero'ed out by mke2fs.

The s_mount_options field has the unfortunate distinction of being the first
field beyond 0x200 in the superblock (i.e. second sector of 1kB superblock
area).  This means it could have been corrupted at some time in the past by an
incomplete write or similar, and no e2fsck will have checked/fixed this.

Looking at the 'dd' output, it is clear that both the area before and after the
512-bytes of the original superblock were clobbered by 0xffff data at one time
or another, and I suspect the superblock was rewritten from a backup copy but
only the first sector was written to disk.

(In reply to comment #12)
> I there is a way to fix it on the user space side?

Fairly simple, for this specific case.  It should overwrite the 512-byte area
beyond the superblock with zeroes:

dd if=/dev/zero of=/dev/dsk/by-label/MyBook bs=512 count=1 seek=3 skip=3

That said, I don't know how common or unusual this kind of garbage data is in
this area of the filesystem.  It might make sense that errors parsing of the
s_mount_options field is not taken as a fatal error at mount time, since this
can make a system unbootable, and no e2fsck will fix it.

For e2fsck, it probably makes sense to limit the data in s_mount_opts to
printable ASCII characters, and otherwise zero out any remaining data.  I'm not
sure what to do for the rest of the superblock, however.

Should e2fsck zero out that data if s_mount_opts is found to be bad?  Should we
wait until every field is defined, and then fix them on a case-by-case basis? 
The former is preferable because otherwise it means the kernel can never start
using any of these fields without e2fsck having verified the content first, but
it has the drawback that any corruption just to s_mount_opts may wipe out the
rest of the superblock.

In that regard, it would have been preferable to locate the "s_first_error" and
"s_last_error" fields near the end of the 1kB superblock range, instead of
quickly consuming the rest of the space in the first sector (which we know will
be written atomically), which is why it would be nice if such changes were
discussed and reviewed on the mailing list rather than being presented as a
fait-accompli in some kernel update and/or e2fsprogs release.

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.

  parent reply	other threads:[~2010-11-29 21:55 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-25 21:23 [Bug 23772] New: oops after mounting ext4 fs in 2.6.36.1 (failed to parse options in superblock) bugzilla-daemon
2010-11-25 21:27 ` [Bug 23772] " bugzilla-daemon
2010-11-25 21:31 ` bugzilla-daemon
2010-11-25 21:32 ` bugzilla-daemon
2010-11-26  2:57 ` bugzilla-daemon
2010-11-26 14:24 ` bugzilla-daemon
2010-11-26 14:27 ` bugzilla-daemon
2010-11-26 14:40 ` bugzilla-daemon
2010-11-26 14:45 ` bugzilla-daemon
2010-11-26 14:46 ` bugzilla-daemon
2010-11-26 20:45 ` bugzilla-daemon
2010-11-26 22:13 ` bugzilla-daemon
2010-11-29 19:34 ` bugzilla-daemon
2010-11-29 19:36 ` bugzilla-daemon
2010-11-29 21:55 ` bugzilla-daemon [this message]
2010-11-29 23:45   ` [PATCH] annotate superblock field offsets Andreas Dilger
2010-11-29 23:46     ` Eric Sandeen
2010-11-30 16:51 ` [Bug 23772] oops after mounting ext4 fs in 2.6.36.1 (failed to parse options in superblock) bugzilla-daemon
2010-11-30 17:50 ` bugzilla-daemon
2010-11-30 18:07 ` bugzilla-daemon
2010-11-30 20:54 ` bugzilla-daemon
2010-11-30 21:16 ` bugzilla-daemon
2010-12-01 14:58 ` bugzilla-daemon
2012-08-14 13:33 ` bugzilla-daemon

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=201011292155.oATLt4vX027018@demeter2.kernel.org \
    --to=bugzilla-daemon@bugzilla.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    /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.