From patchwork Mon Oct 23 06:30:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10022023 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 CF1ED601E8 for ; Mon, 23 Oct 2017 06:30:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C0346285D4 for ; Mon, 23 Oct 2017 06:30:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B4BEF286FB; Mon, 23 Oct 2017 06:30: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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 4C33A285D4 for ; Mon, 23 Oct 2017 06:30:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751216AbdJWGaa (ORCPT ); Mon, 23 Oct 2017 02:30:30 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:54461 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751083AbdJWGaa (ORCPT ); Mon, 23 Oct 2017 02:30:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:To:From:Sender:Reply-To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=hqIzoiQoRjGoF4jWVaid6eViDeiDp6LoMtcFXDw5ZMY=; b=Fq69cy42fgI7lrxeDn0a3Zgmy Y+xp7GDO1f3K1m47qJnDNztb6ymaA7aArcBisHg2SKZnca0M6XgQ10IfvXVv7LYGxzA2OSjb97LrL A8yfn67dOaH7CkNUZ/ALECh6BBr2mL9bAdRFE/i/yvxG6dWbf1phAogZM6i2U7u12dMLSO4SwSNxY Hj62dandDzmpJEouCoV0PZ0pKkxq8VRzdQ1AMhpzv32xQXQy9iHGVfm6Jiz71d6VLQCrFZb8Kqpu8 3tnt4tMEDlla7GHo76cRwiBP08VQVIA0CwSFqKrC7UPG/3WbWr5lREL3P+S/wIBDTYTwgg+gYtm/S 3ojPIYBJA==; Received: from [46.125.250.114] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1e6WFp-0002nk-EJ for linux-xfs@vger.kernel.org; Mon, 23 Oct 2017 06:30:30 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Subject: [PATCH 2/4] xfs: remove xfs_bmbt_validate_extent Date: Mon, 23 Oct 2017 08:30:15 +0200 Message-Id: <20171023063017.11520-3-hch@lst.de> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171023063017.11520-1-hch@lst.de> References: <20171023063017.11520-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html 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 We have stop supporting file systems without unwritten extent bit support a long time ago, so remove the debug code for it which will get in the way of future changes. Signed-off-by: Christoph Hellwig --- fs/xfs/libxfs/xfs_bmap.c | 8 +------- fs/xfs/libxfs/xfs_bmap_btree.h | 14 -------------- fs/xfs/libxfs/xfs_inode_fork.c | 7 ------- 3 files changed, 1 insertion(+), 28 deletions(-) diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 46813b71dd74..19ec8b1f99dd 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -1166,8 +1166,7 @@ xfs_bmap_add_attrfork( /* * Read in the extents to if_extents. * All inode fields are set up by caller, we just traverse the btree - * and copy the records in. If the file system cannot contain unwritten - * extents, the records are checked for no "state" flags. + * and copy the records in. */ int /* error */ xfs_bmap_read_extents( @@ -1255,11 +1254,6 @@ xfs_bmap_read_extents( xfs_bmbt_rec_host_t *trp = xfs_iext_get_ext(ifp, i); trp->l0 = be64_to_cpu(frp->l0); trp->l1 = be64_to_cpu(frp->l1); - if (!xfs_bmbt_validate_extent(mp, whichfork, trp)) { - XFS_ERROR_REPORT("xfs_bmap_read_extents(2)", - XFS_ERRLEVEL_LOW, mp); - goto error0; - } trace_xfs_read_extent(ip, i, state, _THIS_IP_); } xfs_trans_brelse(tp, bp); diff --git a/fs/xfs/libxfs/xfs_bmap_btree.h b/fs/xfs/libxfs/xfs_bmap_btree.h index 6f891eeb88f6..82d397de8e00 100644 --- a/fs/xfs/libxfs/xfs_bmap_btree.h +++ b/fs/xfs/libxfs/xfs_bmap_btree.h @@ -123,18 +123,4 @@ extern int xfs_bmbt_change_owner(struct xfs_trans *tp, struct xfs_inode *ip, extern struct xfs_btree_cur *xfs_bmbt_init_cursor(struct xfs_mount *, struct xfs_trans *, struct xfs_inode *, int); -/* - * Check that the extent does not contain an invalid unwritten extent flag. - */ -static inline bool xfs_bmbt_validate_extent(struct xfs_mount *mp, int whichfork, - struct xfs_bmbt_rec_host *ep) -{ - if (ep->l0 >> (64 - BMBT_EXNTFLAG_BITLEN) == 0) - return true; - if (whichfork == XFS_DATA_FORK && - xfs_sb_version_hasextflgbit(&mp->m_sb)) - return true; - return false; -} - #endif /* __XFS_BMAP_BTREE_H__ */ diff --git a/fs/xfs/libxfs/xfs_inode_fork.c b/fs/xfs/libxfs/xfs_inode_fork.c index b1e69734c450..48a5dec360cd 100644 --- a/fs/xfs/libxfs/xfs_inode_fork.c +++ b/fs/xfs/libxfs/xfs_inode_fork.c @@ -373,11 +373,6 @@ xfs_iformat_extents( xfs_bmbt_rec_host_t *ep = xfs_iext_get_ext(ifp, i); ep->l0 = get_unaligned_be64(&dp->l0); ep->l1 = get_unaligned_be64(&dp->l1); - if (!xfs_bmbt_validate_extent(mp, whichfork, ep)) { - XFS_ERROR_REPORT("xfs_iformat_extents(2)", - XFS_ERRLEVEL_LOW, mp); - return -EFSCORRUPTED; - } trace_xfs_read_extent(ip, i, state, _THIS_IP_); } } @@ -801,8 +796,6 @@ xfs_iextents_copy( for (i = 0; i < nrecs; i++) { xfs_bmbt_rec_host_t *ep = xfs_iext_get_ext(ifp, i); - ASSERT(xfs_bmbt_validate_extent(ip->i_mount, whichfork, ep)); - start_block = xfs_bmbt_get_startblock(ep); if (isnullstartblock(start_block)) { /*