Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3849723pxb; Tue, 17 Nov 2020 05:21:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJw3pW8i+MVXiH9iZMw/8m+ILlZDrhYdTrWabnsSnHxkRbbWgYINlsn88mjBsOIHiBCOPp4o X-Received: by 2002:a17:906:4a98:: with SMTP id x24mr18963806eju.304.1605619266462; Tue, 17 Nov 2020 05:21:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605619266; cv=none; d=google.com; s=arc-20160816; b=VQYd9SOZlRYFrfoEbdpcKEPQFhAArUpOGuXzaV5G0E9H19I5p9FCQTEzRNJEc8KmSG 7xOQcDBmmGJsb4zjqSwt36sJ9ASmUEcDPiiewjW00N8A5p3hFl9TiBJkOCroNOCIw0vH dKLd7Gv8q1ebFZ0tQHUu5DUt1zhmAlTllzctmgHtqMtAHlKFlUZZm01etHbp3Yu+XQNZ vtAvrHT2H+iKTCQa1G4uyrbqEi77xZMDS2furzBnXvZY3jhiCn0yZMK7tETb3q1QAAbq ckJGvLAeeUxNmg2U7YgVXXkucTztKuKONyroC05SyRJr0Q+P25gV8rScUlHF16GWWYTh enHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=A0Vs5rAmvFWKTScQis4eocAz+r3Yj1LSDYt6pNh0HOg=; b=t7kvlrnVYdYwQ9SSqW/l4MLgkx+J03qOQ5OYT13dMOCmPd3/PLfrJgUrTWvhhPq583 4qIhdE9myt9QklrlqIEctopefmS8tx/dvanU6XGO8gAOJWp+eNjwltcBAIaDrYX/pBrb ixx4xXmTlxBwXrtoeKzNEU+t4c1RYaOeNCz+2aa1PGXqUpwts2a8AiZs1hhx7rh1vI6D TCkaiznsq2M2egwUUlFzgjBkYz5nJBQlOr2qZnmbgqPPpkMhWZvno2O4fujusYO8ofRt dexcVrJGS/Jarw62DRcAnjZQZcktCLLNUsIs+Ui9yK1mPSVqGEv5kaA7mK0cJMlmRnF5 /uTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mBsCrcIt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o13si6819726ejb.377.2020.11.17.05.20.43; Tue, 17 Nov 2020 05:21:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mBsCrcIt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729883AbgKQNQO (ORCPT + 99 others); Tue, 17 Nov 2020 08:16:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:47882 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729487AbgKQNQI (ORCPT ); Tue, 17 Nov 2020 08:16:08 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0B6672151B; Tue, 17 Nov 2020 13:16:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605618966; bh=lxCig9jN4rV94/Ixf9he4zJcNg4cvN90W2b+dS7YWwQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mBsCrcItZA1hJQ8TfiX7T5vQrOGM0wb3TKtWhbzgfoMewIXN5ZoHBB+qQ/HGc/qnG nFubuSYCrIaPsAlL0mRhL+nbZKqcdDiEkrkWZM3ztJeP1l7k9cvdR/b45pRlHcjVOR AXxAJD7A8TP+IACoiPKZlWbgvQYqy9iWAOelk7Kw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Darrick J. Wong" , Christoph Hellwig , Sasha Levin Subject: [PATCH 4.14 38/85] xfs: fix flags argument to rmap lookup when converting shared file rmaps Date: Tue, 17 Nov 2020 14:05:07 +0100 Message-Id: <20201117122112.890908844@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122111.018425544@linuxfoundation.org> References: <20201117122111.018425544@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Darrick J. Wong [ Upstream commit ea8439899c0b15a176664df62aff928010fad276 ] Pass the same oldext argument (which contains the existing rmapping's unwritten state) to xfs_rmap_lookup_le_range at the start of xfs_rmap_convert_shared. At this point in the code, flags is zero, which means that we perform lookups using the wrong key. Fixes: 3f165b334e51 ("xfs: convert unwritten status of reverse mappings for shared files") Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Sasha Levin --- fs/xfs/libxfs/xfs_rmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/xfs/libxfs/xfs_rmap.c b/fs/xfs/libxfs/xfs_rmap.c index 55c88a732690e..1f16c2da24723 100644 --- a/fs/xfs/libxfs/xfs_rmap.c +++ b/fs/xfs/libxfs/xfs_rmap.c @@ -1319,7 +1319,7 @@ xfs_rmap_convert_shared( * record for our insertion point. This will also give us the record for * start block contiguity tests. */ - error = xfs_rmap_lookup_le_range(cur, bno, owner, offset, flags, + error = xfs_rmap_lookup_le_range(cur, bno, owner, offset, oldext, &PREV, &i); XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done); -- 2.27.0