From: Theodore Ts'o <tytso@mit.edu>
To: Andreas Dilger <andreas.dilger@intel.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH 2/2] e2fsck: fix e2fsck -fD directory truncation
Date: Mon, 30 Nov 2015 15:29:52 -0500 [thread overview]
Message-ID: <20151130202952.GH4316@thunk.org> (raw)
In-Reply-To: <1447920799-12834-2-git-send-email-andreas.dilger@intel.com>
On Thu, Nov 19, 2015 at 01:13:19AM -0700, Andreas Dilger wrote:
> When an extent-mapped directory is compacted by "e2fsck -fD" and
> frees enough leaf blocks that it loses an extent tree index block,
> the old e2fsck_rehash_dir->ext2fs_block_iterate3->write_dir_block()
> code would not free the extent block, which would result in the
> extent tree becoming corrupted when it is written out.
>
> Pass 1: Checking inodes, blocks, and sizes
> Inode 17825800, end of extent exceeds allowed value
> (logical block 710, physical block 570459684, len 1019)
>
> This results in loss of a whole index block of directory leaf blocks
> and maybe thousands or millions of files in lost+found.
>
> Fix e2fsck_rehash_dir() to call ext2fs_punch() to free the blocks
> at the end of the directory instead of trying to handle this itself
> while writing out the directory. That properly handles all of the
> cases of updating the extent tree as well as accounting for blocks
> that are released (both leaf blocks and index blocks).
>
> Add a test case for compacting the directory to be smaller than the
> index block that originally caused the corruption.
>
> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Thanks, applied.
- Ted
next prev parent reply other threads:[~2015-11-30 20:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-19 8:13 [PATCH 1/2] libext2fs: fix block-mapped file punch Andreas Dilger
2015-11-19 8:13 ` [PATCH 2/2] e2fsck: fix e2fsck -fD directory truncation Andreas Dilger
2015-11-30 20:29 ` Theodore Ts'o [this message]
2015-11-30 20:28 ` [PATCH 1/2] libext2fs: fix block-mapped file punch 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=20151130202952.GH4316@thunk.org \
--to=tytso@mit.edu \
--cc=andreas.dilger@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).