From patchwork Sun Apr 26 03:49:23 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Theodore Ts'o X-Patchwork-Id: 26467 Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 6E673B7063 for ; Sun, 26 Apr 2009 13:49:43 +1000 (EST) Received: by ozlabs.org (Postfix) id 5E9A9DDEE9; Sun, 26 Apr 2009 13:49:43 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id EE5CEDDDF6 for ; Sun, 26 Apr 2009 13:49:42 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755582AbZDZDth (ORCPT ); Sat, 25 Apr 2009 23:49:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755566AbZDZDth (ORCPT ); Sat, 25 Apr 2009 23:49:37 -0400 Received: from THUNK.ORG ([69.25.196.29]:60015 "EHLO thunker.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755199AbZDZDtc (ORCPT ); Sat, 25 Apr 2009 23:49:32 -0400 Received: from root (helo=closure.thunk.org) by thunker.thunk.org with local-esmtp (Exim 4.50 #1 (Debian)) id 1LxvMs-0006Yd-W4; Sat, 25 Apr 2009 23:49:27 -0400 Received: from tytso by closure.thunk.org with local (Exim 4.69) (envelope-from ) id 1LxvMr-0004Kz-Ji; Sat, 25 Apr 2009 23:49:25 -0400 From: Theodore Ts'o To: Ext4 Developers List Cc: Linux Kernel Developers List , Christoph Hellwig , Al Viro , Theodore Ts'o Subject: [PATCH 3/5] ext4: ext4_mark_recovery_complete() doesn't need to use lock_super Date: Sat, 25 Apr 2009 23:49:23 -0400 Message-Id: <1240717765-16572-4-git-send-email-tytso@mit.edu> X-Mailer: git-send-email 1.5.6.3 In-Reply-To: <1240717765-16572-3-git-send-email-tytso@mit.edu> References: <1240717765-16572-1-git-send-email-tytso@mit.edu> <1240717765-16572-2-git-send-email-tytso@mit.edu> <1240717765-16572-3-git-send-email-tytso@mit.edu> X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@mit.edu X-SA-Exim-Scanned: No (on thunker.thunk.org); SAEximRunCond expanded to false Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org The function ext4_mark_recovery_complete() is called from two call paths: either (a) while mounting the filesystem, in which case there's no danger of any other CPU calling write_super() until the mount is completed, and (b) while remounting the filesystem read-write, in which case the fs core has already locked the superblock, and in any case write_super() wouldn't be called until the filesystem is successfully changed from being mounted read-only to read-write. Signed-off-by: "Theodore Ts'o" --- fs/ext4/super.c | 11 +---------- 1 files changed, 1 insertions(+), 10 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index e0b0c9f..176d43f 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3198,14 +3198,12 @@ static void ext4_mark_recovery_complete(struct super_block *sb, if (jbd2_journal_flush(journal) < 0) goto out; - lock_super(sb); if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER) && sb->s_flags & MS_RDONLY) { EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER); sb->s_dirt = 0; ext4_commit_super(sb, es, 1); } - unlock_super(sb); out: jbd2_journal_unlock_updates(journal); @@ -3438,15 +3436,8 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) (sbi->s_mount_state & EXT4_VALID_FS)) es->s_state = cpu_to_le16(sbi->s_mount_state); - /* - * We have to unlock super so that we can wait for - * transactions. - */ - if (sbi->s_journal) { - unlock_super(sb); + if (sbi->s_journal) ext4_mark_recovery_complete(sb, es); - lock_super(sb); - } } else { int ret; if ((ret = EXT4_HAS_RO_COMPAT_FEATURE(sb,