From patchwork Thu Mar 22 06:24:10 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: 10300897 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 59EA160349 for ; Thu, 22 Mar 2018 06:24:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 418A82997E for ; Thu, 22 Mar 2018 06:24:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 326472999B; Thu, 22 Mar 2018 06:24:17 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, 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 872DD2997E for ; Thu, 22 Mar 2018 06:24:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752175AbeCVGYQ (ORCPT ); Thu, 22 Mar 2018 02:24:16 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:35696 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750886AbeCVGYP (ORCPT ); Thu, 22 Mar 2018 02:24:15 -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 w2M6CJ9s016698; Thu, 22 Mar 2018 06:24:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2017-10-26; bh=ZwRDBuhPdfON/oeB7g/fhInw4td50MZMOPYuQ8kLIlw=; b=AVQ7LkyoRHGgFd+mG5ik/UpBcmPNg2AG5z0sUlCcIwPROtbi46QtFoucOvU2y7ufUzIX qHXxSRu2fCQ/iRf5aHrZBZom2KWFsZfODlQThJTgyKJboTWNLbluHIEEkMnvEs7fOS6J 6g431mlU8hIOQ+LswKsMUDYYY1vRQtOpqXYF4ds7bVvAIxkNpWrf4SJ87J3CWtbVhCpB PLCbKlmWlaMKGvCQwRn0Tpb3J5YlhWgvpqgmRGiXcuXJpPAZKzF/kQwZdBXUhi5q6Qvq YRsu9NNpaKyfnOEeV1PDPlRYjuVOCfjH0b7Y//spmjMDyNh6Jp1iRj5BRMbyeOCcrMqD Pw== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2gv710815y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Mar 2018 06:24:12 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w2M6OB7k010057 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Mar 2018 06:24:11 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w2M6OBfR014886; Thu, 22 Mar 2018 06:24:11 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 21 Mar 2018 23:24:11 -0700 Date: Wed, 21 Mar 2018 23:24:10 -0700 From: "Darrick J. Wong" To: linux-xfs@vger.kernel.org Cc: Brian Foster Subject: [PATCH v2 8/9] xfs: record inode buf errors as a xref error in inode scrubber Message-ID: <20180322062410.GU4818@magnolia> References: <152107377037.19571.8618901963505842632.stgit@magnolia> <152107382051.19571.2865600595521884732.stgit@magnolia> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <152107382051.19571.2865600595521884732.stgit@magnolia> User-Agent: Mutt/1.5.24 (2015-08-30) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8839 signatures=668695 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803200127 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 During the inode btree scrubs we try to confirm the freemask bits against the inode records. If the inode buffer read fails, this is a cross-referencing error, not a corruption of the inode btree itself. Use the xref_process_error call here. Found via core.version middlebit fuzz in xfs/415. The userspace xfs_scrub program will try to repair outright corruptions in the agi/inobt prior to phase 3 so that the inode scan will proceed. If only a cross-referencing error is noted, the repair program defers the repair attempt until it can check the other space metadata at least once. It is therefore essential that the inobt scrubber can correctly distinguish between corruptions and "unable to cross-reference something else with this inobt". Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster --- v2: clarify why we're doing this in the commit message --- fs/xfs/scrub/ialloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/xfs/scrub/ialloc.c b/fs/xfs/scrub/ialloc.c index 63ab3f9..32e0d1a 100644 --- a/fs/xfs/scrub/ialloc.c +++ b/fs/xfs/scrub/ialloc.c @@ -259,7 +259,8 @@ xfs_scrub_iallocbt_check_freemask( error = xfs_imap_to_bp(mp, bs->cur->bc_tp, &imap, &dip, &bp, 0, 0); - if (!xfs_scrub_btree_process_error(bs->sc, bs->cur, 0, &error)) + if (!xfs_scrub_btree_xref_process_error(bs->sc, bs->cur, 0, + &error)) continue; /* Which inodes are free? */