From patchwork Tue Mar 13 14:35:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10279187 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 AC7BF602C2 for ; Tue, 13 Mar 2018 14:36:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E716287E3 for ; Tue, 13 Mar 2018 14:36:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9360829029; Tue, 13 Mar 2018 14:36:09 +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 10D0A287E3 for ; Tue, 13 Mar 2018 14:36:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932312AbeCMOgI (ORCPT ); Tue, 13 Mar 2018 10:36:08 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:60920 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932094AbeCMOgH (ORCPT ); Tue, 13 Mar 2018 10:36:07 -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=ljiqqocUYKz/p/Cnp7pIbF5WfTBXs7AhQv5gmEumyHc=; b=dsD4UfafIBoeFZG9G8XRNS2w2 8Vi/7gsJg1A1B0lCD1vuc1wBAC6vp+fb60WxaUiFEAOxu1fepd9BRBt79UmYJ0yVdIb6dXfObe6Tp 69OU8YjmjN138CGdusUMzkkqkOZLmgBmcziWgQQPEc3rO+HG5hNA9NAnEQB8l01Lk57lBWEghMus7 oZREV+ym/cagSsmCZI9vu+JPNcCiZn2Y5PtxW637KzGaKUHHL0K9100UehuUQwXSme/pFmYA6AQW3 +NTNTvHSHITEuSRCIZ8GQxDLCze3Wbe3yfXvzbCJbNIt3sciYcqR7fpkgIKpOxNF09L8++xo3kgLX 4OYZKrMsA==; Received: from 77.117.139.172.wireless.dyn.drei.com ([77.117.139.172] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1evl27-0004ZN-7y for linux-xfs@vger.kernel.org; Tue, 13 Mar 2018 14:36:07 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Subject: [PATCH 1/8] xfs: fix the check for COW extents in xfs_swap_extents Date: Tue, 13 Mar 2018 15:35:54 +0100 Message-Id: <20180313143601.30028-2-hch@lst.de> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180313143601.30028-1-hch@lst.de> References: <20180313143601.30028-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 i_cnextents does not include delayed allocated extents, so switch to the inode fork size check that we already use in other places instead. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- fs/xfs/xfs_bmap_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c index e0a442f504e5..19ea7d086cf8 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c @@ -2014,11 +2014,11 @@ xfs_swap_extents( ip->i_cowfp = tip->i_cowfp; tip->i_cowfp = cowfp; - if (ip->i_cowfp && ip->i_cnextents) + if (ip->i_cowfp && ip->i_cowfp->if_bytes) xfs_inode_set_cowblocks_tag(ip); else xfs_inode_clear_cowblocks_tag(ip); - if (tip->i_cowfp && tip->i_cnextents) + if (tip->i_cowfp && tip->i_cowfp->if_bytes) xfs_inode_set_cowblocks_tag(tip); else xfs_inode_clear_cowblocks_tag(tip);