From patchwork Sat Aug 11 15:35:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10563497 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 066171510 for ; Sat, 11 Aug 2018 15:35:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7AC0291F3 for ; Sat, 11 Aug 2018 15:35:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DBC4229B80; Sat, 11 Aug 2018 15:35:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A37F291F3 for ; Sat, 11 Aug 2018 15:35:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727386AbeHKSJj (ORCPT ); Sat, 11 Aug 2018 14:09:39 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:56566 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727333AbeHKSJj (ORCPT ); Sat, 11 Aug 2018 14:09:39 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w7BFXpq1068869 for ; Sat, 11 Aug 2018 15:35:05 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=qawlcZqhU2BxP1noZRLGR2p7Qw6nebCJv/gXOtiOnys=; b=iHrmALrK8r7u5ixsB1m6eWEmyis9F2SyQ+Ls789BcNr/xw4ArYf4adl0qNyUIAy8KEV4 wRUuifEgknRBc97PJ5bzciPjj2aGah+WmTz3A02xm5m0zWi5vz6Ukq/jxXOEqCbQn6ex Vdqn6sUKshmeq2M3J5bPKlscP3NCr48yayHnUQ4H/aCFlu3sYz13WWfpSQEbEmGuLdXT xwbCOUQUDZjUidz1uEXbVnsTs5iFHRgE962JjcIE+bWDFCs0tL9a28inHJLh1PfBQbQo IcV3NpyexjeLpbJkmJ66J5e9LxsWZCf9WsQij0SWGsh37f/ropmsBv+uGOdPSZH1bYuw Uw== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2ksreprnmy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sat, 11 Aug 2018 15:35:05 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w7BFZ40w029033 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sat, 11 Aug 2018 15:35:04 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w7BFZ4I1011261 for ; Sat, 11 Aug 2018 15:35:04 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 11 Aug 2018 08:35:03 -0700 Subject: [PATCH 1/6] xfs: recalculate summary counters at mount time if icount is bad From: "Darrick J. Wong" To: darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org Date: Sat, 11 Aug 2018 08:35:03 -0700 Message-ID: <153400170370.27471.3984686896617555055.stgit@magnolia> In-Reply-To: <153400169747.27471.4044680761841034489.stgit@magnolia> References: <153400169747.27471.4044680761841034489.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8981 signatures=668707 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=832 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808110174 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong Since the sb write verifier trips on bad icounts, we should also force a mount time recalculation of the summary counters if the icount is bad. This helps us avoid blowing up at freeze/unmount time when the bad counter gets written back out. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Carlos Maiolino --- fs/xfs/xfs_mount.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 99db27d6ac8a..02d15098dbee 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -637,6 +637,7 @@ xfs_check_summary_counts( */ if (XFS_LAST_UNMOUNT_WAS_CLEAN(mp) && (mp->m_sb.sb_fdblocks > mp->m_sb.sb_dblocks || + !xfs_verify_icount(mp, mp->m_sb.sb_icount) || mp->m_sb.sb_ifree > mp->m_sb.sb_icount)) mp->m_flags |= XFS_MOUNT_BAD_SUMMARY;