Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3851926pxb; Tue, 17 Nov 2020 05:24:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJxZDEzmu4JsBWMEcaulQHj8iJE+SQK/O8/D69cO/EVr6Her9/dsjg7vVfEwZgIYpJXH+4yB X-Received: by 2002:aa7:ce8d:: with SMTP id y13mr7304836edv.65.1605619460826; Tue, 17 Nov 2020 05:24:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605619460; cv=none; d=google.com; s=arc-20160816; b=VyoPdmp84Cu926dM9R9tsAtC2YyEU+HAaLoBvjTP1L+PaBLJevIPlRa1bMUbb/N4iL T6A0ocpvGUAdmiEqKJp7vBcNx423+TfsnZAL0Z2rM72aRAeeUhqM0XhlNt/Xn03T3CEF wNiSGKFKFR58TkbIWLkTe+f32QQkiXOzo9hAJTHEVBvKK/ESqZN1HASO6ZZK/TgHkBgm 2uzwM2Jyi6o+hBJdbIHod80KXoI1nn+y6BC3J3MGTpX2gvyGdLbaYoG0F8AfKUkOIfK9 7hnXcgES61dRz/AhhSbo8Jmz4KygKoE9ry1jLSPvBa9tZii/lj5PUWmIQQtkt0/QdvCb 6YQA== 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=eLDx9nNMLiTaGYuknyFSlJ8CqlYVWONOl6fhcXlhkNo=; b=w0oRu9ykalI/sANPHVvzwfi2gZdcFDrkyyP69hf8qO7KJb7RNswZ7OTM8t6wP0UVx0 e92HegPyKyAs9dpFXJK7K+jixSgDWS4qBzoxiPKMwAtc2uCvJDMT+B4hVDNoPqxnGBy7 k/Xh2eUTtMne7PtNiu/KHf26w0VPGVtENrW9AveYY39dgKC9Sp5ORkDhWtrcLpHLz/p6 55D351PXSOKwOSVT5mv49aTQ0sp03xf6zS2/2CydYP7Wc0+cg6iUSNS7fMSBC5LtVl2R iN1GzH5TV4YFFWcTEvb6n86HY3ecXYwneJP2oJzmzKFum3WeOj0klWumrkbahgBIXQUr K/aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uUJmp+c8; 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 y1si13369908edm.279.2020.11.17.05.23.56; Tue, 17 Nov 2020 05:24:20 -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=uUJmp+c8; 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 S1730419AbgKQNTv (ORCPT + 99 others); Tue, 17 Nov 2020 08:19:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:52620 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730437AbgKQNTh (ORCPT ); Tue, 17 Nov 2020 08:19:37 -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 CFFD12225B; Tue, 17 Nov 2020 13:19:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605619176; bh=snFqh1W3HsHODuPRRzFEPf6AZfPh6NtQMwK7+9Yn7iY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uUJmp+c8lAkBTWKH08OdOm5/NJZp5TzH2FA4WpkZoC/XUowsmJmjSnyqXTAuR7v+s cDQ64cVjVU5mu91EJjidFg4ax9b8Ib5p49v9enQHd8S3OuaqvcXZtLfBspyUBOw/Td 7Rt7Lhtt96iIflXm2ka3EVQzlAo5NDxyhRVY7CGM= 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.19 054/101] xfs: fix flags argument to rmap lookup when converting shared file rmaps Date: Tue, 17 Nov 2020 14:05:21 +0100 Message-Id: <20201117122115.728253200@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122113.128215851@linuxfoundation.org> References: <20201117122113.128215851@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 245af452840ef..ab3e72e702f00 100644 --- a/fs/xfs/libxfs/xfs_rmap.c +++ b/fs/xfs/libxfs/xfs_rmap.c @@ -1387,7 +1387,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); if (error) goto done; -- 2.27.0