lkml.org 
[lkml]   [2012]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: writeback: bad unlock balance detected in 3.5-rc1
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
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
\
 
 \ /
  Last update: 2012-06-08 23:41    [W:0.729 / U:0.716 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site