mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Fengguang Wu <fengguang.wu@intel.com>
To: Jan Kara <jack@suse.cz>
Cc: Dave Jones <davej@redhat.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Fedora Kernel Team <kernel-team@fedoraproject.org>,
	viro@ZenIV.linux.org.uk, Christoph Hellwig <hch@infradead.org>
Subject: Re: inode->i_wb_list corruption.
Date: Tue, 6 Mar 2012 23:26:08 -0800	[thread overview]
Message-ID: <20120307072608.GA24087@localhost> (raw)
In-Reply-To: <20120306210307.GC8781@quack.suse.cz>

On Tue, Mar 06, 2012 at 10:03:07PM +0100, Jan Kara wrote:
> On Tue 06-03-12 13:51:37, Dave Jones wrote:
> > We've had three separate reports against 3.2.x recently where the linked list debugging
> > is getting tripped up by the prev->next pointer being null instead of pointing
> > to the current list entry while walking the i_wb_list
> > 
> > Call traces are slightly different each time, but all end up walking i_wb_list 
> > in dput -> d_kill -> i_put -> evict -> inode_wb_list_del
> > 
> > What protects that list ? It looks to be just bdi->wb.list_lock ?
> > 
> > 
> > full reports at:
> > https://bugzilla.redhat.com/show_bug.cgi?id=784741
> > https://bugzilla.redhat.com/show_bug.cgi?id=799229
> > https://bugzilla.redhat.com/show_bug.cgi?id=799692
>   Hum, interesting! I'd guess this might be caused by f758eeab - adding
> Fengguang and Christoph to CC. But I'm really failing to see how this could
> happen but interesting thing is that in two of the three cases the files
> are on virtual filesystems (once cgroup, once sysfs). These both use
> noop_backing_dev_info.

sysfs/cgroup forgot to init inode->i_wb_list?

This simplified fix inits it in inode_init_always().

The better fix would be to add init_once to sysfs or perhaps fix
sysfs_get_inode()/cgroup_new_inode().

Thanks,
Fengguang

---
 fs/inode.c |    1 +
 1 file changed, 1 insertion(+)

--- linux.orig/fs/inode.c	2012-02-22 19:20:48.374799955 -0800
+++ linux/fs/inode.c	2012-03-06 23:11:29.133899478 -0800
@@ -193,6 +193,7 @@ int inode_init_always(struct super_block
 	inode->i_private = NULL;
 	inode->i_mapping = mapping;
 	INIT_LIST_HEAD(&inode->i_dentry);	/* buggered by rcu freeing */
+	INIT_LIST_HEAD(&inode->i_wb_list);
 #ifdef CONFIG_FS_POSIX_ACL
 	inode->i_acl = inode->i_default_acl = ACL_NOT_CACHED;
 #endif

  reply	other threads:[~2012-03-07  7:31 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-06 18:51 Dave Jones
2012-03-06 21:03 ` Jan Kara
2012-03-07  7:26   ` Fengguang Wu [this message]
2012-03-07 10:42     ` Jan Kara
2012-03-09  8:34       ` Yang Bai
2012-03-09 14:57         ` Dave Jones
2012-03-09 15:19           ` Dave Jones
2012-03-09 16:14             ` Yang Bai
2012-03-09 18:00               ` Dave Jones
2012-03-09 20:08                 ` Keith Packard
2012-03-09 20:19                   ` Josh Boyer
2012-03-09 22:44                     ` Keith Packard
2012-03-12 21:13                       ` Josh Boyer
2012-03-12 21:27                         ` David Woodhouse
2012-03-12 23:26                   ` Dave Jones
2012-03-13  0:06                     ` Keith Packard
2012-03-15 14:08 Petr Tesařík
2012-03-15 14:22 ` Dave Airlie
2012-03-15 14:49 ` Dave Jones

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=20120307072608.GA24087@localhost \
    --to=fengguang.wu@intel.com \
    --cc=davej@redhat.com \
    --cc=hch@infradead.org \
    --cc=jack@suse.cz \
    --cc=kernel-team@fedoraproject.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /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

Powered by JetHome