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; From patchwork Sat Aug 11 15:35:09 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: 10563499 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 46A7E1510 for ; Sat, 11 Aug 2018 15:35:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3406C291F3 for ; Sat, 11 Aug 2018 15:35:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2897D29B80; Sat, 11 Aug 2018 15:35:14 +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 A3BA5291F3 for ; Sat, 11 Aug 2018 15:35:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727396AbeHKSJq (ORCPT ); Sat, 11 Aug 2018 14:09:46 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:39538 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727333AbeHKSJp (ORCPT ); Sat, 11 Aug 2018 14:09:45 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w7BFYbM2078116 for ; Sat, 11 Aug 2018 15:35:11 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=gkfnvBiHicT6Dn5ATRUSIy7yhT7xRy5CW9zdvIf3MBM=; b=Ez+ofasRunJ4YQPPI313JWqUsvDQqFyTgeRobO8YdOUILdkR+pDIp684/bjLl4LkYra/ AhsiEIx9aN4+ONsSWtygC6mumcmgjOPX2L9qXoxlGzcZE8TL9pqh15HeaNnssi7++1xW p+W8elhw6KCk2M0JnBSbWZdZnaRgVUzDIYZyyYuRqX1OPHYsF/VrDDuLEqsohxorCgOH a4BUm+4fdtjVd1moFKjakNy9Q1fxQdgGLjnPI8Q6MliHnzE6ki1tBbzgpP/vnCxe7AHl u6hxxBnhpKtLMovFQ6xZoj3lmNVsGg2BmuOnGxRe5/CLNP5IETutPNAokJ0iRs8ucoVW nw== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2ksq7t0que-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sat, 11 Aug 2018 15:35:11 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w7BFZA3C024879 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sat, 11 Aug 2018 15:35:10 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w7BFZAmA011267 for ; Sat, 11 Aug 2018 15:35:10 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 11 Aug 2018 08:35:09 -0700 Subject: [PATCH 2/6] xfs: xrep_findroot_block should reject root blocks with siblings From: "Darrick J. Wong" To: darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org Date: Sat, 11 Aug 2018 08:35:09 -0700 Message-ID: <153400170977.27471.4053607329690572828.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=999 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 In xrep_findroot_block, if we find a candidate root block with sibling pointers or sibling blocks on the same tree level, we should not return that block as a tree root because root blocks cannot have siblings. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Carlos Maiolino --- fs/xfs/scrub/repair.c | 47 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c index 17cf48564390..42d8c798ce7d 100644 --- a/fs/xfs/scrub/repair.c +++ b/fs/xfs/scrub/repair.c @@ -690,6 +690,7 @@ xrep_findroot_block( struct xfs_buf *bp; struct xfs_btree_block *btblock; xfs_daddr_t daddr; + int block_level; int error; daddr = XFS_AGB_TO_DADDR(mp, ri->sc->sa.agno, agbno); @@ -727,17 +728,51 @@ xrep_findroot_block( goto out; bp->b_ops = fab->buf_ops; - /* Ignore this block if it's lower in the tree than we've seen. */ - if (fab->root != NULLAGBLOCK && - xfs_btree_get_level(btblock) < fab->height) - goto out; - /* Make sure we pass the verifiers. */ bp->b_ops->verify_read(bp); if (bp->b_error) goto out; + + /* If we've recorded a root candidate... */ + block_level = xfs_btree_get_level(btblock); + if (fab->root != NULLAGBLOCK) { + /* + * ...and this no-sibling root block candidate has the same + * level as the recorded candidate, there's no way we're going + * to accept any candidates at this tree level. Stash a root + * block of zero because the height is still valid, but no + * AG btree can root at agblock 0. Callers should verify the + * root agbno with xfs_verify_agbno... + */ + if (block_level + 1 == fab->height) { + fab->root = 0; + goto out; + } + + /* + * ...and this no-sibling root block is lower in the tree than + * the recorded root block candidate, just ignore it. There's + * still a strong chance that something is wrong with the btree + * itself, but that's not what we're fixing right now. + */ + if (block_level < fab->height) + goto out; + } + + /* + * Root blocks can't have siblings. This level can't be the root, so + * record the tree height (but not the ag block pointer) to force us to + * look for a higher level in the tree. + */ + if (btblock->bb_u.s.bb_leftsib != cpu_to_be32(NULLAGBLOCK) || + btblock->bb_u.s.bb_rightsib != cpu_to_be32(NULLAGBLOCK)) { + fab->root = 0; + fab->height = block_level + 1; + goto out; + } + fab->root = agbno; - fab->height = xfs_btree_get_level(btblock) + 1; + fab->height = block_level + 1; *found_it = true; trace_xrep_findroot_block(mp, ri->sc->sa.agno, agbno, From patchwork Sat Aug 11 15:35:15 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: 10563501 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 32F5C139A for ; Sat, 11 Aug 2018 15:35:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20BAA291F3 for ; Sat, 11 Aug 2018 15:35:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 14F2929C93; Sat, 11 Aug 2018 15:35:20 +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 70DEA291F3 for ; Sat, 11 Aug 2018 15:35:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727398AbeHKSJw (ORCPT ); Sat, 11 Aug 2018 14:09:52 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:50254 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727333AbeHKSJw (ORCPT ); Sat, 11 Aug 2018 14:09:52 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w7BFYiKL094464 for ; Sat, 11 Aug 2018 15:35:17 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=/fKiwmQX0bGgNw94fP7zOzSHjrQeKHcti82jeKDYI0k=; b=1H+tmQdQOaP1CATU6YXz95vuRmhG7hX6Ymy/a3ddrr7pFBB9I3pJkJOHGAdp55uny8Jc xDm/BEQCx9wtd3m8XALRl99hPSLdqPXYbB6k9P/l4P0/5OTlxmWcFdBO03v4bUuQolgs wSG/EP4u806z8+/DAPh9l3FW6HtxYPRz+vfI7jZQAiN45sma4qdfxR0Eh25ms2adBI6t /Asmr7BJHob8po9PW0b6H3up4IrFzEB+RG26Wz6qrv7FIEc/+t9f3R1vLG6w6UJEnAUF aiMJN5YTKu7VJQuwxMNPB5tP0n8eanU94pVLGv5RDI2xhoPWBHW28/4WazdcmszQDekN 8A== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2ksnacrvn4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sat, 11 Aug 2018 15:35:17 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w7BFZGrq029646 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sat, 11 Aug 2018 15:35:17 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w7BFZGoh031748 for ; Sat, 11 Aug 2018 15:35:16 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 11 Aug 2018 08:35:16 -0700 Subject: [PATCH 3/6] xfs: sanity check ag header values in xrep_calc_ag_resblks From: "Darrick J. Wong" To: darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org Date: Sat, 11 Aug 2018 08:35:15 -0700 Message-ID: <153400171586.27471.17428651076544146314.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=999 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 Check the values we read in from the AG headers when calculating the block reservations for a repair transaction. If they're obviously wrong, substitute worst case assumptions (rather than ENOSPC on a bogus reservatoin request). Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Carlos Maiolino --- fs/xfs/scrub/repair.c | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c index 42d8c798ce7d..97c3077fb005 100644 --- a/fs/xfs/scrub/repair.c +++ b/fs/xfs/scrub/repair.c @@ -195,8 +195,8 @@ xrep_calc_ag_resblks( struct xfs_scrub_metadata *sm = sc->sm; struct xfs_perag *pag; struct xfs_buf *bp; - xfs_agino_t icount = 0; - xfs_extlen_t aglen = 0; + xfs_agino_t icount = NULLAGINO; + xfs_extlen_t aglen = NULLAGBLOCK; xfs_extlen_t usedlen; xfs_extlen_t freelen; xfs_extlen_t bnobt_sz; @@ -208,20 +208,14 @@ xrep_calc_ag_resblks( if (!(sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR)) return 0; - /* Use in-core counters if possible. */ pag = xfs_perag_get(mp, sm->sm_agno); - if (pag->pagi_init) + if (pag->pagi_init) { + /* Use in-core icount if possible. */ icount = pag->pagi_count; - - /* - * Otherwise try to get the actual counters from disk; if not, make - * some worst case assumptions. - */ - if (icount == 0) { + } else { + /* Try to get the actual counters from disk. */ error = xfs_ialloc_read_agi(mp, NULL, sm->sm_agno, &bp); - if (error) { - icount = mp->m_sb.sb_agblocks / mp->m_sb.sb_inopblock; - } else { + if (!error) { icount = pag->pagi_count; xfs_buf_relse(bp); } @@ -229,18 +223,32 @@ xrep_calc_ag_resblks( /* Now grab the block counters from the AGF. */ error = xfs_alloc_read_agf(mp, NULL, sm->sm_agno, 0, &bp); - if (error) { - aglen = mp->m_sb.sb_agblocks; - freelen = aglen; - usedlen = aglen; - } else { + if (!error) { aglen = be32_to_cpu(XFS_BUF_TO_AGF(bp)->agf_length); - freelen = pag->pagf_freeblks; + freelen = be32_to_cpu(XFS_BUF_TO_AGF(bp)->agf_freeblks); usedlen = aglen - freelen; xfs_buf_relse(bp); } xfs_perag_put(pag); + /* If the icount is impossible, make some worst-case assumptions. */ + if (icount == NULLAGINO || + !xfs_verify_agino(mp, sm->sm_agno, icount)) { + xfs_agino_t first, last; + + xfs_agino_range(mp, sm->sm_agno, &first, &last); + icount = last - first + 1; + } + + /* If the block counts are impossible, make worst-case assumptions. */ + if (aglen == NULLAGBLOCK || + aglen != xfs_ag_block_count(mp, sm->sm_agno) || + freelen >= aglen) { + aglen = xfs_ag_block_count(mp, sm->sm_agno); + freelen = aglen; + usedlen = aglen; + } + trace_xrep_calc_ag_resblks(mp, sm->sm_agno, icount, aglen, freelen, usedlen); From patchwork Sat Aug 11 15:35:22 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: 10563503 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 DC99A1510 for ; Sat, 11 Aug 2018 15:35:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8F0529BE4 for ; Sat, 11 Aug 2018 15:35:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BBC5929CFD; Sat, 11 Aug 2018 15:35:25 +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 3F7DC29BE4 for ; Sat, 11 Aug 2018 15:35:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727411AbeHKSJ6 (ORCPT ); Sat, 11 Aug 2018 14:09:58 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:56780 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727333AbeHKSJ5 (ORCPT ); Sat, 11 Aug 2018 14:09:57 -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 w7BFXgVU068822 for ; Sat, 11 Aug 2018 15:35:23 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=gMuTWa2eAnui5SXnKdkHdibfxuZhiKEd1cnyup2fvxE=; b=A3JRe8ksq8ibr1bG1Um6i1NwgwlBUDMb32AUp4ws4DN4wV7wOmDO28WLqZBjdOE7B+O+ BpXUbUy7UArZl7dtqaJZNwHm5qSCD9gqjOdLuFz1hamkD1UhyqPI31Lo8EdPe+2swN7o d58vq4xJ7qUEkmiuVhIk5YBiqcxJBiKbW0UNKT1+TygRyLkc1iW4ksSvvCDl6lt9YL/p XP1Ovh4d1cIzWFzGeX7BbZ6YobgO0lDKGjIq8KfQ0SoLA1rO4Pj415BRRAPBEwk584Zb sng1aHl5IfJ3R+Gfk6h0v9A2awNF80XABOR+gET+KZhW28CXe4f9dECbhxX8owFveYqi cA== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2ksreprnnk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sat, 11 Aug 2018 15:35:23 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w7BFZMQw002836 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sat, 11 Aug 2018 15:35:22 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w7BFZMgG008130 for ; Sat, 11 Aug 2018 15:35:22 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 11 Aug 2018 08:35:22 -0700 Subject: [PATCH 4/6] xfs: fix buffer state management in xrep_findroot_block From: "Darrick J. Wong" To: darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org Date: Sat, 11 Aug 2018 08:35:22 -0700 Message-ID: <153400172200.27471.13133656951315541955.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=999 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 We don't quite handle buffer state properly in online repair's findroot routine. If the buffer is already in-core we don't want to trash its b_ops and state, so first we should try _get_buf to grab the buffer. If the buffer is loaded, we only want to verify the structure of the buffer since it could be dirty and the crc hasn't yet been recalculated. Only if the buffer hasn't been read in should try _read_buf, and if we were the ones who read the buffer then we must be careful to oneshot the buffer so that a subsequent _read_buf won't find a buffer with no ops. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Carlos Maiolino --- fs/xfs/scrub/repair.c | 67 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 54 insertions(+), 13 deletions(-) diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c index 97c3077fb005..fae50dced8bc 100644 --- a/fs/xfs/scrub/repair.c +++ b/fs/xfs/scrub/repair.c @@ -697,6 +697,7 @@ xrep_findroot_block( struct xfs_mount *mp = ri->sc->mp; struct xfs_buf *bp; struct xfs_btree_block *btblock; + xfs_failaddr_t fa; xfs_daddr_t daddr; int block_level; int error; @@ -718,28 +719,68 @@ xrep_findroot_block( return error; } - error = xfs_trans_read_buf(mp, ri->sc->tp, mp->m_ddev_targp, daddr, - mp->m_bsize, 0, &bp, NULL); - if (error) - return error; - /* - * Does this look like a block matching our fs and higher than any - * other block we've found so far? If so, reattach buffer verifiers - * so the AIL won't complain if the buffer is also dirty. + * Try to grab the buffer, on the off chance it's already in memory. + * If the buffer doesn't have the DONE flag set it hasn't been read + * into memory yet. Drop the buffer and read the buffer with NULL + * b_ops. (This could race with another read_buf.) If we get the + * buffer back with NULL b_ops then we know that there weren't any + * other readers. There's a risk we won't match the buffer with any + * of the findroot prototypes, so we want to encourage the buffer layer + * to drop the buffer as soon as possible. */ + bp = xfs_trans_get_buf(ri->sc->tp, mp->m_ddev_targp, daddr, + mp->m_bsize, 0); + if (!bp) + return -ENOMEM; + if (!(bp->b_flags & XBF_DONE)) { + xfs_trans_brelse(ri->sc->tp, bp); + + error = xfs_trans_read_buf(mp, ri->sc->tp, mp->m_ddev_targp, + daddr, mp->m_bsize, 0, &bp, NULL); + if (error) + return error; + if (!bp->b_ops) + xfs_buf_oneshot(bp); + } + + /* Does this look like a block matching our fs? */ btblock = XFS_BUF_TO_BLOCK(bp); if (be32_to_cpu(btblock->bb_magic) != fab->magic) goto out; if (xfs_sb_version_hascrc(&mp->m_sb) && !uuid_equal(&btblock->bb_u.s.bb_uuid, &mp->m_sb.sb_meta_uuid)) goto out; - bp->b_ops = fab->buf_ops; - /* Make sure we pass the verifiers. */ - bp->b_ops->verify_read(bp); - if (bp->b_error) - goto out; + /* + * We've matched this buffer by magic number to this findroot + * prototype. If there are no buffer ops attached, attach the one + * specified by the prototype. Otherwise, the buffer ops must match + * the prototype. We don't want to disturb existing b_ops. + */ + if (bp->b_ops) { + if (bp->b_ops != fab->buf_ops) + goto out; + /* + * If the buffer was already incore (on a v5 fs) then it should + * already have had b_ops assigned. Call ->verify_struct to + * check the structure. Avoid checking the CRC because we + * don't calculate CRCs until the buffer is written by the log. + */ + fa = bp->b_ops->verify_struct(bp); + if (fa) + goto out; + } else { + /* + * If we have to assign buffer ops, that means that nobody's + * checked the buffer structure or its CRC. Do both now by + * calling ->verify_read. + */ + bp->b_ops = fab->buf_ops; + bp->b_ops->verify_read(bp); + if (bp->b_error) + goto out; + } /* If we've recorded a root candidate... */ block_level = xfs_btree_get_level(btblock); From patchwork Sat Aug 11 15:35:28 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: 10563505 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 CF5FE1510 for ; Sat, 11 Aug 2018 15:35:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BDB9E29BE4 for ; Sat, 11 Aug 2018 15:35:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B1E5429CFD; Sat, 11 Aug 2018 15:35:31 +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 6569129BE4 for ; Sat, 11 Aug 2018 15:35:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727416AbeHKSKE (ORCPT ); Sat, 11 Aug 2018 14:10:04 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:50394 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727333AbeHKSKE (ORCPT ); Sat, 11 Aug 2018 14:10:04 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w7BFY6TB094027 for ; Sat, 11 Aug 2018 15:35:29 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=3gJ1O6TCxWhT9JHlwSg64OrMqvTs6qOGC+a+g2m1Bj8=; b=Bx1t1YQrGEMnHZumDpOXvuZ27ya+4haoN+1C4Q0shR3OvS/oA0uh6904j2X69aq4S6/K aAOnx82q2HwfreJTR6ymH92XSmalnpv8ZPT8oTkEslWed5QJ3cxG39nMFYl+7iDui76n fWBy8+/aGYh6sblPDT50uNJFZ9AjcD0ss1kwmUE03f5oiC66r/qgds9BvkgQiK9/aanl kYQanx5ynNmIdylkwv9a8JShrbWjI4kxMPGN/OGFnFapZvG06pyVndjShnwscuoAs15Z 6s3GEJ7yDwnonL5x/fE484F5JigLoO8Nwj3HoXc8je9GYiJYLdehx6R2wvGJAvgDyscM Tw== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2ksnacrvng-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sat, 11 Aug 2018 15:35:29 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w7BFZS2B025391 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sat, 11 Aug 2018 15:35:29 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w7BFZSbf008153 for ; Sat, 11 Aug 2018 15:35:28 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 11 Aug 2018 08:35:28 -0700 Subject: [PATCH 5/6] iomap: fix WARN_ON_ONCE on uninitialized variable From: "Darrick J. Wong" To: darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org Date: Sat, 11 Aug 2018 08:35:28 -0700 Message-ID: <153400172814.27471.988480858889151684.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=999 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 In commit 9dc55f1389f9569 ("iomap: add support for sub-pagesize buffered I/O without buffer heads") we moved the initialization of poff (it's computed from pos) into a separate helper function. Inline data only ever deals with pos == 0, hence the WARN_ON_ONCE, but now we're testing an uninitialized variable. Therefore, change the test to check the parameter directly. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Carlos Maiolino --- fs/iomap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/iomap.c b/fs/iomap.c index 8bd54c08deee..8a18163dc432 100644 --- a/fs/iomap.c +++ b/fs/iomap.c @@ -290,7 +290,7 @@ iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data, sector_t sector; if (iomap->type == IOMAP_INLINE) { - WARN_ON_ONCE(poff); + WARN_ON_ONCE(pos); iomap_read_inline_data(inode, page, iomap); return PAGE_SIZE; } From patchwork Sat Aug 11 15:35:34 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: 10563507 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 74D71139A for ; Sat, 11 Aug 2018 15:35:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6323029BE4 for ; Sat, 11 Aug 2018 15:35:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5744829D55; Sat, 11 Aug 2018 15:35:39 +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 DB1BA29BE4 for ; Sat, 11 Aug 2018 15:35:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727426AbeHKSKL (ORCPT ); Sat, 11 Aug 2018 14:10:11 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:39792 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727333AbeHKSKL (ORCPT ); Sat, 11 Aug 2018 14:10:11 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w7BFXn2o077655; Sat, 11 Aug 2018 15:35:36 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=/rpKnVTw7HtX7hCvXrH2kk4PH6CJuY+Q9u1IPYAEM4A=; b=lCnW23XBJzTZKmTKwuTPa1bhuz/iwOGXTdXqlV6utKtwaCwqG1yOe+qg5SYK24iiSh3W MZxMPO72itM/wSPq1ssfMrFNCgBQdGQHmZ3q27gmNYd6wagpHRLg9NP0S6469yBq2bJs yK5juFw4DWh8op7KqADPKZVszFbk6/ibVr67ysUG8n3FrM1ZYIFYhs3GRHNl7ivrOCd5 AKencTVWcKPNnSGErjBwyK4pZaDH5/wqwkpR847dQqnuyaiaISStstveleNV6YhPPCMv Bqs9lNAlg1scccIfSJq4xg6lMrM7hxwK+yTpYHuFDK2wzVZI97oMwBsKx+eegfATLzNx nw== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2ksq7t0qv3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 11 Aug 2018 15:35:35 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w7BFZZnM015337 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 11 Aug 2018 15:35:35 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w7BFZY5G011449; Sat, 11 Aug 2018 15:35:34 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 11 Aug 2018 08:35:34 -0700 Subject: [PATCH 6/6] xfs: don't crash the vfs on a garbage inline symlink From: "Darrick J. Wong" To: darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, wen.xu@gatech.edu Date: Sat, 11 Aug 2018 08:35:34 -0700 Message-ID: <153400173428.27471.504421086760762828.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=549 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 The VFS routine that calls ->get_link blindly copies whatever's returned into the user's buffer. If we return a NULL pointer, the vfs will crash on the null pointer. Therefore, return -EFSCORRUPTED instead of blowing up the kernel. Reported-by: wen.xu@gatech.edu Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson --- fs/xfs/xfs_iops.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index 0ef5ad7fb851..26007a9db49d 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -471,8 +471,16 @@ xfs_vn_get_link_inline( struct inode *inode, struct delayed_call *done) { + char *ptr; + ASSERT(XFS_I(inode)->i_df.if_flags & XFS_IFINLINE); - return XFS_I(inode)->i_df.if_u1.if_data; + + /* + * The VFS crashes on a NULL pointer, so return -EFSCORRUPTED if + * if_data is junk. + */ + ptr = XFS_I(inode)->i_df.if_u1.if_data; + return ptr ? ptr : ERR_PTR(-EFSCORRUPTED); } STATIC int