From: Theodore Ts'o <tytso@mit.edu>
To: Eric Whitney <enwlinux@gmail.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH] ext4: fix xfstest generic/299 block validity failures
Date: Wed, 12 Feb 2014 10:44:03 -0500 [thread overview]
Message-ID: <20140212154403.GB14520@thunk.org> (raw)
In-Reply-To: <20140210200414.GA2155@wallace>
On Mon, Feb 10, 2014 at 03:04:14PM -0500, Eric Whitney wrote:
> Commit a115f749c1 (ext4: remove wait for unwritten extent conversion from
> ext4_truncate) exposed a bug in ext4_ext_handle_uninitialized_extents().
> It can be triggered by xfstest generic/299 when run on a test file
> system created without a journal. This test continuously fallocates and
> truncates files to which random dio/aio writes are simultaneously
> performed by a separate process. The test completes successfully, but
> if the test filesystem is mounted with the block_validity option, a
> warning message stating that a logical block has been mapped to an
> illegal physical block is posted in the kernel log.
>
> The bug occurs when an extent is being converted to the written state
> by ext4_end_io_dio() and ext4_ext_handle_uninitialized_extents()
> discovers a mapping for an existing uninitialized extent. Although it
> sets EXT4_MAP_MAPPED in map->m_flags, it fails to set map->m_pblk to
> the discovered physical block number. Because map->m_pblk is not
> otherwise initialized or set by this function or its callers, its
> uninitialized value is returned to ext4_map_blocks(), where it is
> stored as a bogus mapping in the extent status tree.
>
> Since map->m_pblk can accidentally contain illegal values that are
> larger than the physical size of the file system, calls to
> check_block_validity() in ext4_map_blocks() that are enabled if the
> block_validity mount option is used can fail, resulting in the logged
> warning message.
>
> Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Applied, many thanks!! I've marked this with:
Cc: stable@vger.kernel.org # 3.11+
- Ted
next prev parent reply other threads:[~2014-02-12 15:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-10 20:04 [PATCH] ext4: fix xfstest generic/299 block validity failures Eric Whitney
2014-02-12 15:44 ` Theodore Ts'o [this message]
2014-02-18 14:46 ` Theodore Ts'o
2014-02-18 21:36 ` Eric Whitney
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=20140212154403.GB14520@thunk.org \
--to=tytso@mit.edu \
--cc=enwlinux@gmail.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.