From patchwork Fri Sep 26 08:58:21 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sato X-Patchwork-Id: 1638 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org 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 D7977DDDF4 for ; Fri, 26 Sep 2008 18:59:36 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755268AbYIZI6r (ORCPT ); Fri, 26 Sep 2008 04:58:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755024AbYIZI6r (ORCPT ); Fri, 26 Sep 2008 04:58:47 -0400 Received: from TYO201.gate.nec.co.jp ([202.32.8.193]:60757 "EHLO tyo201.gate.nec.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755259AbYIZI6p (ORCPT ); Fri, 26 Sep 2008 04:58:45 -0400 Received: from mailgate3.nec.co.jp ([10.7.69.161]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m8Q8wM8r016428; Fri, 26 Sep 2008 17:58:22 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id m8Q8wMc00958; Fri, 26 Sep 2008 17:58:22 +0900 (JST) Received: from tatewaki.jp.nec.com (tatewaki.jp.nec.com [10.26.220.19]) by mailsv3.nec.co.jp (8.13.8/8.13.4) with ESMTP id m8Q8wLuQ015456; Fri, 26 Sep 2008 17:58:21 +0900 (JST) Received: from TNESB07336 ([10.64.168.65] [10.64.168.65]) by mail.jp.nec.com with ESMTP; Fri, 26 Sep 2008 17:58:21 +0900 To: Andrew Morton , Christoph Hellwig , "linux-fsdevel@vger.kernel.org" , "dm-devel@redhat.com" , "viro@ZenIV.linux.org.uk" , "linux-ext4@vger.kernel.org" , "xfs@oss.sgi.com" , "axboe@kernel.dk" , "mtk.manpages@googlemail.com" Cc: "linux-kernel@vger.kernel.org" Subject: [PATCH 5/10] gfs2: Fix error handling in write_super_lockfs/unlockfs Message-Id: <20080926175821t-sato@mail.jp.nec.com> Mime-Version: 1.0 X-Mailer: WeMail32[2.51] ID:1K0086 From: Takashi Sato Date: Fri, 26 Sep 2008 17:58:21 +0900 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Changed write_super_lockfs so that it returns an error in case of an failure. unlockfs always returns 0. Signed-off-by: Takashi Sato Signed-off-by: Masayuki Hamaguchi --- ops_super.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -uprN -X linux-2.6.27-rc7-lockfs-reiserfs/Documentation/dontdiff linux-2.6.27-rc7-lockfs-reiserfs/fs/gfs2/ops_super .c linux-2.6.27-rc7-lockfs-gfs2/fs/gfs2/ops_super.c --- linux-2.6.27-rc7-lockfs-reiserfs/fs/gfs2/ops_super.c 2008-09-26 12:24:01.000000000 +0900 +++ linux-2.6.27-rc7-lockfs-gfs2/fs/gfs2/ops_super.c 2008-09-26 17:02:06.000000000 +0900 @@ -161,18 +161,18 @@ static int gfs2_sync_fs(struct super_blo } /** - * gfs2_write_super_lockfs - prevent further writes to the filesystem + * gfs2_freeze - prevent further writes to the filesystem * @sb: the VFS structure for the filesystem * */ -static void gfs2_write_super_lockfs(struct super_block *sb) +static int gfs2_freeze(struct super_block *sb) { struct gfs2_sbd *sdp = sb->s_fs_info; int error; if (test_bit(SDF_SHUTDOWN, &sdp->sd_flags)) - return; + return -EINVAL; for (;;) { error = gfs2_freeze_fs(sdp); @@ -192,17 +192,19 @@ static void gfs2_write_super_lockfs(stru fs_err(sdp, "retrying...\n"); msleep(1000); } + return 0; } /** - * gfs2_unlockfs - reallow writes to the filesystem + * gfs2_unfreeze - reallow writes to the filesystem * @sb: the VFS structure for the filesystem * */ -static void gfs2_unlockfs(struct super_block *sb) +static int gfs2_unfreeze(struct super_block *sb) { gfs2_unfreeze_fs(sb->s_fs_info); + return 0; } /** @@ -505,8 +507,8 @@ const struct super_operations gfs2_super .put_super = gfs2_put_super, .write_super = gfs2_write_super, .sync_fs = gfs2_sync_fs, - .write_super_lockfs = gfs2_write_super_lockfs, - .unlockfs = gfs2_unlockfs, + .freeze_fs = gfs2_freeze, + .unfreeze_fs = gfs2_unfreeze, .statfs = gfs2_statfs, .remount_fs = gfs2_remount_fs, .clear_inode = gfs2_clear_inode,