From nobody Sun Feb 8 21:18:18 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5DC8BC43334 for ; Fri, 8 Jul 2022 16:39:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238480AbiGHQjQ (ORCPT ); Fri, 8 Jul 2022 12:39:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238087AbiGHQjN (ORCPT ); Fri, 8 Jul 2022 12:39:13 -0400 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD53822BFB; Fri, 8 Jul 2022 09:39:12 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 6DD903200998; Fri, 8 Jul 2022 12:39:11 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 08 Jul 2022 12:39:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-transfer-encoding:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1657298350; x=1657384750; bh=U3b/H981CGu0C2wC9Ts2JrTkTC7Oo8KLBZW KsNQwvjA=; b=sNlj8utVGC0vIfiqJuCfPiXc7bDpbSIghAa2ibMfR0+3lmre7h/ bkjqWOnQIq9JERNm8h2aCUPGpo1NBA7Cn+5LNQgOPFPKG2B4vtRLvWwX1feWkyxM kMuruV9kZBNSUsuZbyaUMSbzPRYx2GkYTfK8+6bkv530NGqimavpWfa8aSDho2MY 4m/tLHN+bSxGFLXaNP6sPthDn5A/FI+3Fa5kBzioe7Ejmle3CQb97nhLvZ5qPxQa e7QbcHFXFQGBwremK4ujrTCe0NNpxUnEqahDXuBjN0cX6knW9IivvrTmnLDpzuBt +WO+BI8Zrs/u7T78QDjQx5Pt26T3v41qJ0w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1657298350; x=1657384750; bh=U3b/H981CGu0C 2wC9Ts2JrTkTC7Oo8KLBZWKsNQwvjA=; b=zXCBKYLSEAVEPR6sIJRpBCJLDFjZF Dzh8pqG/UgiCP9+pB2Yjcc6dtWFTkyMEjmAyZBbr25oSOfhaPQ4tUnDYJoAJ2SZ0 oML6LbPCU/fGYAB8HIvO8KiR8HJP1S31NrZwBFgfBIkW8OEcPPT49AplrsHDXMVg Rnqvse2u//zm/rLCxlpHqUm1q7Y1YwcH3agBeQEdIio7x0Kk2V4S67XJ0GoN8ufU n+WZJoPDKD3nkeskhHMJ68BN2W6wRSPelEZMezf/MeD4QOI3zAKFTT8I/jhGSb62 TrXPDQuKZOl5sRRag0ha9CfVDKAHxs415AaxuS16YPsP6Qt/4LY9XjOvw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudeijedguddtfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeffvghm ihcuofgrrhhivgcuqfgsvghnohhurhcuoeguvghmihesihhnvhhishhisghlvghthhhinh hgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpeejffejgffgueegudevvdejkefg hefghffhffejteekleeufeffteffhfdtudehteenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpeguvghmihesihhnvhhishhisghlvghthhhinhhg shhlrggsrdgtohhm X-ME-Proxy: Feedback-ID: iac594737:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 8 Jul 2022 12:39:10 -0400 (EDT) From: Demi Marie Obenour To: Juergen Gross , Greg KH , Stefano Stabellini , Oleksandr Tyshchenko , Demi Marie Obenour Cc: Linux kernel regressions , stable@vger.kernel.org, Linux kernel mailing list , Xen developer discussion Subject: [PATCH 5.4] Ignore failure to unmap -1 Date: Fri, 8 Jul 2022 12:37:47 -0400 Message-Id: <20220708163750.2005-4-demi@invisiblethingslab.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220708163750.2005-1-demi@invisiblethingslab.com> References: <20220708163750.2005-1-demi@invisiblethingslab.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The error paths of gntdev_mmap() can call unmap_grant_pages() even though not all of the pages have been successfully mapped. This will trigger the WARN_ON()s in __unmap_grant_pages_done(). The number of warnings can be very large; I have observed thousands of lines of warnings in the systemd journal. Avoid this problem by only warning on unmapping failure if the handle being unmapped is not -1. The handle field of any page that was not successfully mapped will be -1, so this catches all cases wherr unmapping can legitimately fail. Suggested-by: Juergen Gross Cc: stable@vger.kernel.org Signed-off-by: Demi Marie Obenour Fixes: ee25841221c1 ("xen/gntdev: Avoid blocking in unmap_grant_pages()") --- drivers/xen/gntdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c index f464793477650e631c8928e85c1990c5964c2e94..bba849e5d8a7b4d54925b842fbe= 3c6792e0f0214 100644 --- a/drivers/xen/gntdev.c +++ b/drivers/xen/gntdev.c @@ -413,7 +413,8 @@ static void __unmap_grant_pages_done(int result, unsigned int offset =3D data->unmap_ops - map->unmap_ops; =20 for (i =3D 0; i < data->count; i++) { - WARN_ON(map->unmap_ops[offset+i].status); + WARN_ON(map->unmap_ops[offset+i].status && + map->unmap_ops[offset+i].handle !=3D -1); pr_debug("unmap handle=3D%d st=3D%d\n", map->unmap_ops[offset+i].handle, map->unmap_ops[offset+i].status); --=20 Sincerely, Demi Marie Obenour (she/her/hers) Invisible Things Lab