All of lore.kernel.org
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: linux-ext4@vger.kernel.org
Cc: Zheng Liu <gnehzuil.liu@gmail.com>
Subject: Re: [REGRESSION] xfstests #269 without journal failure against 'dev' branch
Date: Thu, 21 Feb 2013 14:44:48 -0500	[thread overview]
Message-ID: <20130221194448.GB17322@thunk.org> (raw)
In-Reply-To: <20130218172140.GA3056@gmail.com>

I was able to reproduce the failure reliably by using a 5G tmpfs file
for the VM's disk file, and bisected this down to:

    ext4: support simple conversion of extent-mapped inodes to use i_blocks
    
    In order to make it simpler to test the code which support
    i_blocks/indirect-mapped inodes, support the conversion of inodes
    which are less than 12 blocks and which are contained in no more than
    a single extent.
    
    The primary intended use of this code is to converting freshly created
    zero-length files and empty directories.
    
    Note that the version of chattr in e2fsprogs 1.42.7 and earlier has a
    check that prevents the clearing of the extent flag.  A simple patch
    which allows "chattr -e <file>" to work will be checked into the
    e2fsprogs git repository.
    
    Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>

I don't think this is actually causing the problem, but rather
exposing a latent bug in fs/ext4/indirect.c.  From some code
inspection that I did investigating the resize2fs bug, it's pretty
clear that indirect.c codepath has some bugs dealing with ENOSPC
conditions when allocating indirect metadata blocks.

Xfstests #269 runs fsstress in parallel with ENOSPC hitters, and one
of the things fsstress does is to call the FS_IOC_SETFLAGS with random
values, so with this commit, we are migrating some small files to use
indirect block..  I suspect that when we then do some writes to these
small files and they hit an ENOSPC condition, it causes the file
system corruption.

I patched ext4_ind_migrate() to log an ext4_warning and then return
-ENOSPC, and confirmed that (a) with ext4_end_migrate() disabled, the
fs corruption problem went away, and (b) fsstress is calling
FS_IOC_SETFLAGS with completely random values, and thus causing us to
migrate some of the extent-mapped files to indirect block mapped
files.

Given that extents->indirect migration isn't really that important, I
propose we deal with this by dropping the above commit for now.  It's
clear we need to fix up fs/ext4/indirect.c, especially as more
distro's consider using ext4 to support ext3 file systems.  So after
we fix the ENOSPC bugs I've noticed in ext4_alloc_branch(), we can try
introducing the extent->indirect migration feature again for the next
merge window.

Zheng, thanks for calling this bug to our attention, and thanks for
your extensive testing efforts!

       	      	  	       	      - Ted


  reply	other threads:[~2013-02-21 19:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-17 17:09 [REGRESSION] xfstests #269 without journal failure against 'dev' branch Zheng Liu
2013-02-18  4:57 ` Theodore Ts'o
2013-02-18 17:21   ` Zheng Liu
2013-02-21 19:44     ` Theodore Ts'o [this message]
2013-02-22  2:44       ` Zheng Liu

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=20130221194448.GB17322@thunk.org \
    --to=tytso@mit.edu \
    --cc=gnehzuil.liu@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.