linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: "Ted Ts'o" <tytso@mit.edu>
Cc: Alex <alex.vizor@gmail.com>,
	adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org,
	Dave Chinner <dchinner@redhat.com>
Subject: Re: WARNING: at fs/inode.c:884 unlock_new_inode+0x34/0x59()
Date: Mon, 05 Dec 2011 15:07:23 -0600	[thread overview]
Message-ID: <4EDD328B.3000907@redhat.com> (raw)
In-Reply-To: <4EDD2F9E.3000704@redhat.com>

On 12/5/11 2:54 PM, Eric Sandeen wrote:
> On 11/27/11 3:34 PM, Ted Ts'o wrote:
>> On Sun, Nov 27, 2011 at 11:24:03PM +0300, Alex wrote:
>>> BTW, after last resume from disk fs was corrupted but fsck managed
>>> to fix this error. So I think severity of this issue should be
>>> raised.
>>
>> Can you reproduce this reliably?  What was running at the time of the s2disk?
>>
>> What appears to be going on is that insert_inode_locked() is failing
>> at fs/ext4/ialloc.c:887, probably because there's another inode with
>> that inode number already on the superblock's hash list.  The error
>> codepath if insert_inode_locked() fail is incorrect; it's going to
>> fail_drop, which tries dropping the inode's dquot (but we haven't
>> calle ddquot_initialize)inode) yet) and calls unlock_new_inode(), but
>> I_NEW hasn't been set because insert_inode_locked().
> 
> OK; this looks to be the result of:
> 
> commit 250df6ed274d767da844a5d9f05720b804240197
> Author: Dave Chinner <dchinner@redhat.com>
> Date:   Tue Mar 22 22:23:36 2011 +1100
> 
>     fs: protect inode->i_state with inode->i_lock
> 
> (went in on 2.6.39)
> 
> because before that, insert_inode_locked() used to unconditionally do:
> 
> -       inode->i_state |= I_NEW;
> 
> but that's gone now.  Now if the function fails it'll return the
> inode w/o I_NEW set.
> 
> ext2/3/4, jffs2, and jfs all call unlock_new_inode() on insert_inode_locked()
> failure, and all would warn on this path.
> 
> I'm still not clear on what's causing insert_inode_locked() to fail,
> but it used to be harmless (or at least silent) before.
> 
> I suppose it makes most sense to fix all callers to not clear I_NEW
> on failure, unless it's too icky; it does seem weird to have I_NEW set
> if we return with failure.
> 
> -Eric
> 

OTOH Al thought it would be reasonable to set I_NEW on failure as well,
and then we wouldn't have to touch the callers.

-Eric

> 
> 
>> So the warning is easy to fix; we just need to have it jump to fail
>> instead of fail_drop.  But the bigger issue is why did
>> insert_inode_locked() failed in the first place.
>>
>> Did this error happen *right* after the system resumed, or did some
>> amount of time pass before the warning triggered?  This could have
>> happened because the in-memory (or possibly on-disk) copy of the inode
>> allocation bitmap has gotten corrupted, for example.
>>
>> What was the nature of the file system corruption which e2fsck decided
>> that it need to correct?
>>
>> Regards,
>>
>> 						- Ted
>> --
\

      reply	other threads:[~2011-12-05 21:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4ED2994A.9080907@gmail.com>
2011-11-27 20:24 ` WARNING: at fs/inode.c:884 unlock_new_inode+0x34/0x59() Alex
2011-11-27 21:34   ` Ted Ts'o
2011-11-28 12:38     ` Alexander Zhavnerchik
     [not found]     ` <4ED3CF24.2050702@gmail.com>
2011-11-28 18:28       ` Theodore Tso
2011-11-28 19:08         ` Alex
2011-12-01 22:33           ` Eric Sandeen
2011-12-05 20:54     ` Eric Sandeen
2011-12-05 21:07       ` Eric Sandeen [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=4EDD328B.3000907@redhat.com \
    --to=sandeen@redhat.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=alex.vizor@gmail.com \
    --cc=dchinner@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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).