All of lore.kernel.org
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH 09/19] e2fsck: correctly preserve fs flags when modifying ignore-csum-error flag
Date: Sat, 2 Aug 2014 22:48:52 -0400	[thread overview]
Message-ID: <20140803024852.GI24826@thunk.org> (raw)
In-Reply-To: <20140801181241.12496.65228.stgit@birch.djwong.org>

On Fri, Aug 01, 2014 at 11:12:41AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> When we need to modify the "ignore checksum error" behavior flag to
> get us past a library call, it's possible that the library call can
> result in other flag bits being changed.  Therefore, it is not correct
> to restore unconditionally the previous flags value, since this will
> have unintended side effects on the other fs->flags; nor is it correct
> to assume that we can unconditionally set (or clear) the "ignore csum
> error" flag bit.  Therefore, we must merge the previous value of the
> "ignore csum error" flag with the value of flags after the call.
> 
> Note that we want to leave checksum verification on as much as
> possible because doing so exposes e2fsck bugs where two metadata
> blocks are "sharing" the same disk block, and attempting to fix one
> before relocating the other causes major filesystem damage.  The
> damage is much more obvious when a previously checked piece of
> metadata suddenly fails in a subsequent pass.
> 
> The modifications to the pass 2, 3, and 3A code are justified as
> follows: When e2fsck encounters a block of directory entries and
> cannot find the placeholder entry at the end that contains the
> checksum, it will try to insert the placeholder.  If that fails, it
> will schedule the directory for a pass 3A reconstruction.  Until that
> happens, we don't want directory block writing (pass 2), block
> iteration (pass 3), or block reading (pass 3A) to fail due to checksum
> errors, because failing to find the placeholder is itself a checksum
> verification error, which causes e2fsck to abort without fixing
> anything.
> 
> The e2fsck call to ext2fs_read_bitmaps must never fail due to a
> checksum error because e2fsck subsequently (a) verifies the bitmaps
> itself; or (b) decides that they don't match what has been observed,
> and rewrites them.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Applied, thanks.

						- Ted

  reply	other threads:[~2014-08-03  2:48 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-01 18:11 [PATCH 00/19] e2fsprogs patchbomb 7/14, part 2.1 Darrick J. Wong
2014-08-01 18:11 ` [PATCH 01/19] e2fuzz: fix fs handle cleanup when closing fails Darrick J. Wong
2014-08-03  2:22   ` Theodore Ts'o
2014-08-01 18:11 ` [PATCH 02/19] e2fsck: never free critical metadata blocks in the block found map Darrick J. Wong
2014-08-03  2:22   ` Theodore Ts'o
2014-08-01 18:11 ` [PATCH 03/19] e2fsck: use root dir for lost+found when really desperate Darrick J. Wong
2014-08-03  2:25   ` Theodore Ts'o
2014-08-05  0:58     ` Darrick J. Wong
2014-08-05  2:06       ` Theodore Ts'o
2014-08-01 18:12 ` [PATCH 04/19] dumpe2fs: complain when checksum verification fails Darrick J. Wong
2014-08-03  2:26   ` Theodore Ts'o
2014-08-01 18:12 ` [PATCH 05/19] libext2fs: check EA block headers when reading in the block Darrick J. Wong
2014-08-03  2:33   ` Theodore Ts'o
2014-08-01 18:12 ` [PATCH 06/19] e2fsck: try to salvage extent blocks with bad checksums Darrick J. Wong
2014-08-03  2:33   ` Theodore Ts'o
2014-08-01 18:12 ` [PATCH 07/19] e2fsck: try to salvage corrupt directory entry blocks Darrick J. Wong
2014-08-03  2:33   ` Theodore Ts'o
2014-08-01 18:12 ` [PATCH 08/19] e2fsck: offer to clear inode table blocks that are insane Darrick J. Wong
2014-08-03  2:46   ` Theodore Ts'o
2014-08-01 18:12 ` [PATCH 09/19] e2fsck: correctly preserve fs flags when modifying ignore-csum-error flag Darrick J. Wong
2014-08-03  2:48   ` Theodore Ts'o [this message]
2014-08-01 18:12 ` [PATCH 10/19] libext2fs: Don't cache inodes that fail checksum verification Darrick J. Wong
2014-08-03  2:50   ` Theodore Ts'o
2014-08-01 18:12 ` [PATCH 11/19] e2fsck: disable checksum verification in a few select places Darrick J. Wong
2014-08-03  2:51   ` Theodore Ts'o
2014-08-01 18:13 ` [PATCH 12/19] e2fsck: always ask to fix an inode that fails checksum verification Darrick J. Wong
2014-08-03  2:55   ` Theodore Ts'o
2014-08-01 18:13 ` [PATCH 13/19] tests: add regression tests for EA blocks with bad checksums Darrick J. Wong
2014-08-03  3:42   ` Theodore Ts'o
2014-08-01 18:13 ` [PATCH 14/19] tests: add tests for handling of corrupt extents Darrick J. Wong
2014-08-03  3:47   ` Theodore Ts'o
2014-08-01 18:13 ` [PATCH 15/19] tests: add tests for directory entry blocks with checksum errors Darrick J. Wong
2014-08-03  3:49   ` Theodore Ts'o
2014-08-01 18:13 ` [PATCH 16/19] tests: add regression tests for MMP blocks with bad checksums Darrick J. Wong
2014-08-03  3:49   ` Theodore Ts'o
2014-08-01 18:13 ` [PATCH 17/19] tests: add regression tests for superblocks " Darrick J. Wong
2014-08-03  3:50   ` Theodore Ts'o
2014-08-01 18:13 ` [PATCH 18/19] tests: add regression tests for group descriptors " Darrick J. Wong
2014-08-03  3:51   ` Theodore Ts'o
2014-08-01 18:13 ` [PATCH 19/19] tests: add regression tests for inodes " Darrick J. Wong
2014-08-03  3:52   ` Theodore Ts'o

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=20140803024852.GI24826@thunk.org \
    --to=tytso@mit.edu \
    --cc=darrick.wong@oracle.com \
    --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.