Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp380696ybl; Wed, 4 Dec 2019 04:25:49 -0800 (PST) X-Google-Smtp-Source: APXvYqxPiEeyVmR6aaAPGtugpot8Jk9+By2Z0mJXEEXtkVBgHQ545fE8HGcOK6Iq3HrytKEj4K0c X-Received: by 2002:aca:3b54:: with SMTP id i81mr2388229oia.155.1575462349178; Wed, 04 Dec 2019 04:25:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575462349; cv=none; d=google.com; s=arc-20160816; b=saTK/Wdw5NCYJUSfbpFGcEogNx7k0BAgIu8OQI1yLHIrTrk9DVU1bkDPOaJkMnTZdW CBuS8LzZ0Z25eLvqjQnWRC5lSaYlUS1C82LVDWgnuHmC8b/MkcnLFeV3BQE/O6arpENO KD3GjWura5fPoAzTMX4xf8Mi9PYAL2W7cTmY+Mtj4fvpLXk4f8+OTfPklJCHeH6Ptb0T YKJoEQOvioV5q2UfjcSZGfNN/XNBHb6Z/t2h7otYIQZ9AwLYgg4akkB+aWmP1KP6TRFJ Q3rEo1BtVDdxi611u1ehCOLzN+dGOILoGTkr2RRn7n7B4whWxilYtwVe7gfJtaZU4lKW UT4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=iHqDvpQdAYD0PCMISv/+PRf+T59Wjr6BbKqJF4d88WM=; b=I9L/OUrt9xaxVlkZGa1F7TZm4DKrHT4MvxFY+zcoRYwrLZN7q7SlXpl2LW/xQ6aZu2 2IacTJ8CXo7xEZz5qyHzf3PjbtOQP7fRE4oCHyOa3rDD7YGesHWzgF1o+fzwL74f9AWS Dt51k/iLm5NTey6F3vVus3R1c5k1Kgx60yn3Fs29eYtGFM+iiXTPCKLHYi88OhT+V+cK L/LxkSkqmlvZb8smqWTq/h3gCTgJ0FzSiNCuVv8KwBCYQQpL50wkSauPlvjeThF8NdZi Zekw5P8Cy8S3j0zfI5AywWpZix/p4jjZp7cNgUg4jpLY9+FvFZCacxneNMAfhowc3GbI 9rqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a21si2852860otr.308.2019.12.04.04.25.33; Wed, 04 Dec 2019 04:25:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727469AbfLDMZ2 (ORCPT + 99 others); Wed, 4 Dec 2019 07:25:28 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:6749 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727682AbfLDMZ2 (ORCPT ); Wed, 4 Dec 2019 07:25:28 -0500 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 38917AC9038451EDD238; Wed, 4 Dec 2019 20:25:26 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.439.0; Wed, 4 Dec 2019 20:25:17 +0800 From: "zhangyi (F)" To: CC: , , , , , Subject: [PATCH v3 1/4] jbd2: switch to use jbd2_journal_abort() when failed to submit the commit record Date: Wed, 4 Dec 2019 20:46:11 +0800 Message-ID: <20191204124614.45424-2-yi.zhang@huawei.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20191204124614.45424-1-yi.zhang@huawei.com> References: <20191204124614.45424-1-yi.zhang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.124.28] X-CFilter-Loop: Reflected Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org We invoke jbd2_journal_abort() to abort the journal and record errno in the jbd2 superblock when committing journal transaction besides the failure on submitting the commit record. But there is no need for the case and we can also invoke jbd2_journal_abort() instead of __jbd2_journal_abort_hard(). Fixes: 818d276ceb83a ("ext4: Add the journal checksum feature") Signed-off-by: zhangyi (F) Reviewed-by: Jan Kara --- fs/jbd2/commit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c index 132fb92098c7..87b88d910306 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c @@ -785,7 +785,7 @@ void jbd2_journal_commit_transaction(journal_t *journal) err = journal_submit_commit_record(journal, commit_transaction, &cbh, crc32_sum); if (err) - __jbd2_journal_abort_hard(journal); + jbd2_journal_abort(journal, err); } blk_finish_plug(&plug); @@ -876,7 +876,7 @@ void jbd2_journal_commit_transaction(journal_t *journal) err = journal_submit_commit_record(journal, commit_transaction, &cbh, crc32_sum); if (err) - __jbd2_journal_abort_hard(journal); + jbd2_journal_abort(journal, err); } if (cbh) err = journal_wait_on_commit_record(journal, cbh); -- 2.17.2