From patchwork Thu Oct 19 06:59:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10016091 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 C935B60215 for ; Thu, 19 Oct 2017 07:00:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA92328C64 for ; Thu, 19 Oct 2017 07:00:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ACCF328CA3; Thu, 19 Oct 2017 07:00:41 +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 4500728C64 for ; Thu, 19 Oct 2017 07:00:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751622AbdJSHAk (ORCPT ); Thu, 19 Oct 2017 03:00:40 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:59896 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751595AbdJSHAk (ORCPT ); Thu, 19 Oct 2017 03:00:40 -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=fbBHa12heU3CWfxnMbA/HwpipHh9YWK9vjgFYTUE704=; b=YSS8zjwmkMDY8kc0YMjvptLd3 HBPnFL2IpY7voDJ+KDvgerkSFW1l9kflJJBSCIDZA/yVSVm8LRTvSgXY7O/5NaPIJouhR3ZAfH58a mTYjbDc4aqF2oR4pmZnmXENfChsN4hJZ8lEMJwWtLEij9R48yy1GJS5F3kXCE+qEZ7RfWc9WsRLkl cYwod3H9htgNn/Z/OwV5oTDCrxHFIJEXrpGgDzk/nAZtx/ukifZShY5MSIMw6JWSZGFthH+AuDiZm CTzM4MAEZteZrKHChygfoFXc7xr5qTU5gsMd/pxrKcH9NL76bXq6YVZtqkUfwBKxBeuQoN8amCAP7 pwHFElgiQ==; Received: from 212095007233.public.telering.at ([212.95.7.233] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1e54op-0005ve-DR for linux-xfs@vger.kernel.org; Thu, 19 Oct 2017 07:00:39 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Subject: [PATCH 12/15] xfs: update got in xfs_bmap_shift_update_extent Date: Thu, 19 Oct 2017 08:59:39 +0200 Message-Id: <20171019065942.18813-13-hch@lst.de> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171019065942.18813-1-hch@lst.de> References: <20171019065942.18813-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 This way the caller gets the proper updated extent returned in got. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- fs/xfs/libxfs/xfs_bmap.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 703596caf255..2de9458903b6 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -5580,35 +5580,33 @@ xfs_bmap_shift_update_extent( xfs_fileoff_t startoff) { struct xfs_mount *mp = ip->i_mount; - struct xfs_bmbt_irec new; + struct xfs_bmbt_irec prev = *got; int error, i; *logflags |= XFS_ILOG_CORE; - new = *got; - new.br_startoff = startoff; + got->br_startoff = startoff; if (cur) { - error = xfs_bmbt_lookup_eq(cur, got, &i); + error = xfs_bmbt_lookup_eq(cur, &prev, &i); if (error) return error; XFS_WANT_CORRUPTED_RETURN(mp, i == 1); - error = xfs_bmbt_update(cur, &new); + error = xfs_bmbt_update(cur, got); if (error) return error; } else { *logflags |= XFS_ILOG_DEXT; } - xfs_iext_update_extent(ip, xfs_bmap_fork_to_state(whichfork), idx, - &new); + xfs_iext_update_extent(ip, xfs_bmap_fork_to_state(whichfork), idx, got); /* update reverse mapping */ - error = xfs_rmap_unmap_extent(mp, dfops, ip, whichfork, got); + error = xfs_rmap_unmap_extent(mp, dfops, ip, whichfork, &prev); if (error) return error; - return xfs_rmap_map_extent(mp, dfops, ip, whichfork, &new); + return xfs_rmap_map_extent(mp, dfops, ip, whichfork, got); } int