From patchwork Tue Sep 15 09:02:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongsheng Yang X-Patchwork-Id: 517743 X-Patchwork-Delegate: richard@nod.at Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C86DA14018C for ; Tue, 15 Sep 2015 19:14:14 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZbmGx-0006wm-EA; Tue, 15 Sep 2015 09:11:31 +0000 Received: from [59.151.112.132] (helo=heian.cn.fujitsu.com) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZbmF4-0002nf-W5 for linux-mtd@lists.infradead.org; Tue, 15 Sep 2015 09:09:36 +0000 X-IronPort-AV: E=Sophos;i="5.15,520,1432569600"; d="scan'208";a="100730392" Received: from unknown (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 15 Sep 2015 17:12:16 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id t8F999Zs008081; Tue, 15 Sep 2015 17:09:09 +0800 Received: from yds-PC.g08.fujitsu.local (10.167.226.66) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Tue, 15 Sep 2015 17:09:24 +0800 From: Dongsheng Yang To: , , , Subject: [PATCH v3 26/39] ubifs: suspend & resume quota properly in ubifs_remount Date: Tue, 15 Sep 2015 17:02:21 +0800 Message-ID: <1442307754-13233-27-git-send-email-yangds.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1442307754-13233-1-git-send-email-yangds.fnst@cn.fujitsu.com> References: <1442307754-13233-1-git-send-email-yangds.fnst@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.66] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150915_020935_422898_F1A4A29F X-CRM114-Status: UNSURE ( 7.00 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.1 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.8 RDNS_NONE Delivered to internal network by a host with no rDNS X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fsdevel@vger.kernel.org, Dongsheng Yang , linux-mtd@lists.infradead.org Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Dongsheng Yang Reviewed-by: Richard Weinberger --- fs/ubifs/super.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 59cdfc2..cc2988f 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -2014,11 +2014,17 @@ static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data) err = ubifs_remount_rw(c); if (err) return err; + err = dquot_resume(sb, -1); + if (err) + return err; } else if (!c->ro_mount && (*flags & MS_RDONLY)) { if (c->ro_error) { ubifs_msg(c, "cannot re-mount R/O due to prior errors"); return -EROFS; } + err = dquot_suspend(sb, -1); + if (err) + return err; ubifs_remount_ro(c); }