From: Jan Kara <jack@suse.cz>
To: Fengguang Wu <fengguang.wu@intel.com>
Cc: Jan Kara <jack@suse.cz>, "Theodore Ts'o" <tytso@mit.edu>,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: writeback: bad unlock balance detected in 3.5-rc1
Date: Fri, 8 Jun 2012 22:50:31 +0200 [thread overview]
Message-ID: <20120608205031.GG21080@quack.suse.cz> (raw)
In-Reply-To: <20120608154535.GA887@localhost>
[-- Attachment #1: Type: text/plain, Size: 1128 bytes --]
On Sat 09-06-12 00:45:35, Wu Fengguang wrote:
> On Fri, Jun 08, 2012 at 05:07:36PM +0200, Jan Kara wrote:
> > On Fri 08-06-12 10:36:13, Ted Tso wrote:
> > >
> > > I can reproduce this fairly easily by using ext4 w/o a journal, running
> > > under KVM with 1024megs memory, with fsstress (xfstests #13):
>
> Good catch, thanks!
>
> > Argh, I wonder how come I didn't hit this. Does attached patch fix the
> > problem?
>
> > diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
> > index 8d2fb8c..41a3ccf 100644
> > --- a/fs/fs-writeback.c
> > +++ b/fs/fs-writeback.c
> > @@ -664,6 +664,7 @@ static long writeback_sb_inodes(struct super_block *sb,
> > /* Wait for I_SYNC. This function drops i_lock... */
> > inode_sleep_on_writeback(inode);
> > /* Inode may be gone, start again */
> > + spin_lock(&wb->list_lock);
> > continue;
> > }
>
> That looks like the fix. So I pushed it to writeback-for-next.
> Thanks for the quick fixing!
Attached is a version with proper sign-off and changelog. Just in case
you didn't create one yourself already.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
[-- Attachment #2: 0001-writeback-Fix-lock-imbalance-in-writeback_sb_inodes.patch --]
[-- Type: text/x-patch, Size: 906 bytes --]
>From 98fecbcb9edf39b4ab6aab8a85342f77665cac4d Mon Sep 17 00:00:00 2001
From: Jan Kara <jack@suse.cz>
Date: Fri, 8 Jun 2012 17:08:03 +0200
Subject: [PATCH] writeback: Fix lock imbalance in writeback_sb_inodes()
Fix bug introduced by 169ebd90. We have to have wb_list_lock locked when
restarting writeback loop after having waited for inode writeback.
Signed-off-by: Jan Kara <jack@suse.cz>
---
fs/fs-writeback.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 8d2fb8c..41a3ccf 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -664,6 +664,7 @@ static long writeback_sb_inodes(struct super_block *sb,
/* Wait for I_SYNC. This function drops i_lock... */
inode_sleep_on_writeback(inode);
/* Inode may be gone, start again */
+ spin_lock(&wb->list_lock);
continue;
}
inode->i_state |= I_SYNC;
--
1.7.1
next prev parent reply other threads:[~2012-06-08 20:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-08 14:36 Theodore Ts'o
2012-06-08 15:07 ` Jan Kara
2012-06-08 15:45 ` Fengguang Wu
2012-06-08 15:51 ` Sedat Dilek
2012-06-08 16:00 ` Fengguang Wu
2012-06-08 20:50 ` Jan Kara [this message]
2012-06-11 11:21 ` Artem Bityutskiy
2012-06-11 11:21 ` Fengguang Wu
2012-06-08 20:28 ` Ted Ts'o
2012-06-08 23:37 ` Fengguang Wu
2012-06-09 2:38 ` Ted Ts'o
2012-06-09 11:07 ` Fengguang Wu
2012-06-09 11:17 ` Ted Ts'o
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=20120608205031.GG21080@quack.suse.cz \
--to=jack@suse.cz \
--cc=fengguang.wu@intel.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@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
Powered by JetHome