From patchwork Thu May 6 10:35:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Surbhi Palande X-Patchwork-Id: 51824 X-Patchwork-Delegate: stefan.bader@canonical.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 9A6B2B7D20 for ; Thu, 6 May 2010 20:35:12 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1O9yQ6-0007Pl-T1; Thu, 06 May 2010 11:35:06 +0100 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1O9yQ4-0007Oo-Am for kernel-team@lists.ubuntu.com; Thu, 06 May 2010 11:35:04 +0100 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1O9yQ4-0008UA-6s for ; Thu, 06 May 2010 11:35:04 +0100 Received: from a88-112-254-38.elisa-laajakaista.fi ([88.112.254.38] helo=canonical.com) by hutte.canonical.com with esmtpsa (TLS-1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1O9yQ4-000216-0o for kernel-team@lists.ubuntu.com; Thu, 06 May 2010 11:35:04 +0100 From: Surbhi Palande To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/2] writeback: fix __sync_filesystem(sb, 0) on umount Date: Thu, 6 May 2010 13:35:00 +0300 Message-Id: X-Mailer: git-send-email 1.7.0.4 In-Reply-To: References: In-Reply-To: References: X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com From: Dmitry Monakhov BugLink: http://launchpad.net/bugs/543617 __sync_filesystem(sb, 0) is no longer works on umount because sb can not be pined, Because s_mount sem is downed for write and s_root is NULL. In fact umount is a special case similar to WB_SYNC_ALL, where sb is pinned already. BADCOMMIT: 03ba3782e8dcc5b0e1efe440d33084f066e38cae Signed-off-by: Dmitry Monakhov (cherry-picked from https://bugzilla.kernel.org/attachment.cgi?id=26224) Signed-off-by: Surbhi Palande --- fs/fs-writeback.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 4102f20..937a8ae 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -583,9 +583,9 @@ static int pin_sb_for_writeback(struct writeback_control *wbc, unpin_sb_for_writeback(psb); /* - * Caller must already hold the ref for this + * Caller must already hold the ref for integrity sync, and on umount */ - if (wbc->sync_mode == WB_SYNC_ALL) { + if (wbc->sync_mode == WB_SYNC_ALL || !sb->s_root) { WARN_ON(!rwsem_is_locked(&sb->s_umount)); return 0; } @@ -597,6 +597,7 @@ static int pin_sb_for_writeback(struct writeback_control *wbc, spin_unlock(&sb_lock); goto pinned; } + WARN_ON(1); /* * umounted, drop rwsem again and fall through to failure */