From patchwork Thu Jun 28 17:29:37 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: 10494591 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 A2A226022E for ; Thu, 28 Jun 2018 17:29:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8AAAB2A584 for ; Thu, 28 Jun 2018 17:29:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7F01A2A5A2; Thu, 28 Jun 2018 17:29:53 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, 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 0A3AC2A584 for ; Thu, 28 Jun 2018 17:29:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934012AbeF1R3w (ORCPT ); Thu, 28 Jun 2018 13:29:52 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:45156 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933925AbeF1R3v (ORCPT ); Thu, 28 Jun 2018 13:29:51 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w5SHT6fj052080; Thu, 28 Jun 2018 17:29:39 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=9y0V2pMyFJt1iEwe9dd7cJpk83w7Bj/cNutbwMdBOqc=; b=qY0n+kxaBT1q6TnooH3AUVsjty9G3CzOxYnbxKjlts+5VDM0tNbdIjfb0lbD6VrL2eRk r00UtGqNyEej+3qZXgivhulhhqG9AV/fj+ZUS4GS2GujBY/evshbYiMSf1mhOs+CNFjv vrHdHR46QkVx2EWeqoJi2bCjwCS8TLoFWBQLDJlziVk6xeNjZixos1kaPVR/hjMFdk8G cQZ8/JLufPcYNXiXzGE6hqOvqeWkG6sv2FQbp0xIO5DjgS0O8Z9I9FMGBmOLaQbVI4a2 yyvbUFsD7Q0WHndUcJhy4PpAGhm4bmDw9fBDg3iZZkS1dqB6tR6rWpmQgyNJ24zrPYl+ kw== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2120.oracle.com with ESMTP id 2jukhskdee-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Jun 2018 17:29:39 +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 w5SHTcJU002109 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Jun 2018 17:29:38 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w5SHTc27022726; Thu, 28 Jun 2018 17:29:38 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 28 Jun 2018 10:29:38 -0700 Date: Thu, 28 Jun 2018 10:29:37 -0700 From: "Darrick J. Wong" To: sandeen@redhat.com Cc: linux-xfs@vger.kernel.org Subject: [PATCH 11/10] xfs_repair: clear extent size hints when clearing inode core Message-ID: <20180628172937.GI5711@magnolia> References: <153006766483.20121.9285982017465570544.stgit@magnolia> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <153006766483.20121.9285982017465570544.stgit@magnolia> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8938 signatures=668703 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=721 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1806280197 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 In kernel 4.18 we become more strict about what can be in the extent size hint fields, even for freed inodes. Therefore, if repair decides to clear out an inode core, zero the hint fields and clear the flags so that the kernel won't trip over the cleared inode if and when it tries to read the chunk. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen --- repair/dinode.c | 10 ++++++++++ 1 file changed, 10 insertions(+) -- 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/repair/dinode.c b/repair/dinode.c index f9b2bac0..4118db7c 100644 --- a/repair/dinode.c +++ b/repair/dinode.c @@ -194,6 +194,11 @@ clear_dinode_core(struct xfs_mount *mp, xfs_dinode_t *dinoc, xfs_ino_t ino_num) dinoc->di_anextents = 0; } + if (be32_to_cpu(dinoc->di_extsize) != 0) { + __dirty_no_modify_ret(dirty); + dinoc->di_extsize = 0; + } + if (dinoc->di_version > 1 && be32_to_cpu(dinoc->di_nlink) != 0) { __dirty_no_modify_ret(dirty); @@ -237,6 +242,11 @@ clear_dinode_core(struct xfs_mount *mp, xfs_dinode_t *dinoc, xfs_ino_t ino_num) dinoc->di_changecount = 0; } + if (be32_to_cpu(dinoc->di_cowextsize) != 0) { + __dirty_no_modify_ret(dirty); + dinoc->di_cowextsize = 0; + } + return dirty; }