All of lore.kernel.org
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Brian Foster <bfoster@redhat.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [RFC PATCH 1/2] ext4: warn on delalloc md block allocation without reservation
Date: Mon, 23 Jul 2012 00:00:11 -0400	[thread overview]
Message-ID: <20120723040011.GA17588@thunk.org> (raw)
In-Reply-To: <4F79C245.8010101@redhat.com>

On Mon, Apr 02, 2012 at 11:14:13AM -0400, Brian Foster wrote:
> From: Brian Foster <bfoster@redhat.com>
> 
> If we hit a condition where we have allocated metadata blocks that
> were not appropriately reserved, we risk underflow of
> ei->i_reserved_meta_blocks. In turn, this can throw
> sbi->s_dirtyclusters_counter significantly out of whack and undermine
> the nondelalloc fallback logic in ext4_nonda_switch(). Warn if this
> occurs and fix up the counter to handle only what we've reserved.
> This condition is reproduced by xfstests 270 against ext2 with
> delalloc enabled.
> 
> Signed-off-by: Brian Foster <bfoster@redhat.com>

Hi Brian,

Thanks for looking into this xfstests failure and proposing a bug fix.
My apologies for not getting back to you until now.

I modified your commit description a little, but the patch looks good
to me.

  	   	       		    	    - Ted

Author: Brian Foster <bfoster@redhat.com>
Date:   Sun Jul 22 23:59:40 2012 -0400

    ext4: don't let i_reserved_meta_blocks go negative
    
    If we hit a condition where we have allocated metadata blocks that
    were not appropriately reserved, we risk underflow of
    ei->i_reserved_meta_blocks.  In turn, this can throw
    sbi->s_dirtyclusters_counter significantly out of whack and undermine
    the nondelalloc fallback logic in ext4_nonda_switch().  Warn if this
    occurs and set i_allocated_meta_blocks to avoid this problem.
    
    This condition is reproduced by xfstests 270 against ext2 with
    delalloc enabled:
    
    Mar 28 08:58:02 localhost kernel: [  171.526344] EXT4-fs (loop1): delayed blo
    Mar 28 08:58:02 localhost kernel: [  171.526346] EXT4-fs (loop1): This should
    
    270 ultimately fails with an inconsistent filesystem and requires an
    fsck to repair.  The cause of the error is an underflow in
    ext4_da_update_reserve_space() due to an unreserved meta block
    allocation.
    
    Signed-off-by: Brian Foster <bfoster@redhat.com>
    Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
    Cc: stable@vger.kernel.org


      reply	other threads:[~2012-07-23  4:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-02 15:14 [RFC PATCH 1/2] ext4: warn on delalloc md block allocation without reservation Brian Foster
2012-07-23  4:00 ` Theodore Ts'o [this message]

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=20120723040011.GA17588@thunk.org \
    --to=tytso@mit.edu \
    --cc=bfoster@redhat.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.