From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A68BC3F2DA for ; Wed, 4 Mar 2020 07:54:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5D72820866 for ; Wed, 4 Mar 2020 07:54:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728531AbgCDHyI (ORCPT ); Wed, 4 Mar 2020 02:54:08 -0500 Received: from mail105.syd.optusnet.com.au ([211.29.132.249]:34031 "EHLO mail105.syd.optusnet.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725271AbgCDHyI (ORCPT ); Wed, 4 Mar 2020 02:54:08 -0500 Received: from dread.disaster.area (pa49-195-202-68.pa.nsw.optusnet.com.au [49.195.202.68]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 4089A3A2A2B for ; Wed, 4 Mar 2020 18:54:03 +1100 (AEDT) Received: from discord.disaster.area ([192.168.253.110]) by dread.disaster.area with esmtp (Exim 4.92.3) (envelope-from ) id 1j9Oqw-0007li-24 for linux-xfs@vger.kernel.org; Wed, 04 Mar 2020 18:54:02 +1100 Received: from dave by discord.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1j9Oqv-0005cl-Va for linux-xfs@vger.kernel.org; Wed, 04 Mar 2020 18:54:01 +1100 From: Dave Chinner To: linux-xfs@vger.kernel.org Subject: [PATCH 07/11] xfs: clean up xlog_state_ioerror() Date: Wed, 4 Mar 2020 18:53:57 +1100 Message-Id: <20200304075401.21558-8-david@fromorbit.com> X-Mailer: git-send-email 2.24.0.rc0 In-Reply-To: <20200304075401.21558-1-david@fromorbit.com> References: <20200304075401.21558-1-david@fromorbit.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.3 cv=LYdCFQXi c=1 sm=1 tr=0 a=mqTaRPt+QsUAtUurwE173Q==:117 a=mqTaRPt+QsUAtUurwE173Q==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=SS2py6AdgQ4A:10 a=20KFwNOVAAAA:8 a=oIrh420T3QSa8vw9ZH0A:9 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Dave Chinner Signed-off-by: Dave Chinner --- fs/xfs/xfs_log.c | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 0de3c32d42b6..a310ca9e7615 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -875,33 +875,27 @@ xfs_log_mount_cancel( } /* - * Mark all iclogs IOERROR. l_icloglock is held by the caller. + * Mark all iclogs IOERROR. l_icloglock is held by the caller. Returns 1 if the + * log was already in an IO state, 0 otherwise. From now one, no log flushes + * will occur. */ STATIC int xlog_state_ioerror( - struct xlog *log) + struct xlog *log) { - xlog_in_core_t *iclog, *ic; + struct xlog_in_core *iclog = log->l_iclog; + struct xlog_in_core *ic = iclog; log->l_flags |= XLOG_IO_ERROR; + if (iclog->ic_state == XLOG_STATE_IOERROR) + return 1; - iclog = log->l_iclog; - if (iclog->ic_state != XLOG_STATE_IOERROR) { - /* - * Mark all the incore logs IOERROR. - * From now on, no log flushes will result. - */ - ic = iclog; - do { - ic->ic_state = XLOG_STATE_IOERROR; - ic = ic->ic_next; - } while (ic != iclog); - return 0; - } - /* - * Return non-zero, if state transition has already happened. - */ - return 1; + do { + ic->ic_state = XLOG_STATE_IOERROR; + ic = ic->ic_next; + } while (ic != iclog); + + return 0; } /* -- 2.24.0.rc0