From patchwork Fri Oct 25 17:55:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 11212809 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 36D2E139A for ; Fri, 25 Oct 2019 17:55:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DDCDF21D81 for ; Fri, 25 Oct 2019 17:55:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="grl+/RSy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DDCDF21D81 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mellanox.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E73F46B0003; Fri, 25 Oct 2019 13:55:13 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id E25CE6B0006; Fri, 25 Oct 2019 13:55:13 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D12D86B0007; Fri, 25 Oct 2019 13:55:13 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0148.hostedemail.com [216.40.44.148]) by kanga.kvack.org (Postfix) with ESMTP id AA2CE6B0003 for ; Fri, 25 Oct 2019 13:55:13 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 5B19C8249980 for ; Fri, 25 Oct 2019 17:55:13 +0000 (UTC) X-FDA: 76083058506.07.taste68_10577a0cb070e X-Spam-Summary: 2,0,0,02f6bb9129933af6,d41d8cd98f00b204,jgg@mellanox.com,::akpm@linux-foundation.org:daniel.vetter@ffwll.ch,RULES_HIT:10:41:355:379:582:800:960:973:988:989:1152:1260:1277:1311:1313:1314:1345:1437:1513:1515:1516:1518:1521:1535:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3352:3865:3867:3870:3871:3872:3873:4117:5007:6653:10004:10400:11026:11658:11914:12043:12296:12297:12438:12519:12555:12679:12895:13069:13161:13229:13311:13357:13439:14096:14097:14181:14394:14721:21080:21444:21451:21627:30012:30054:30070,0,RBL:40.107.14.45:@mellanox.com:.lbl8.mailshell.net-62.14.31.100 66.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:48,LUA_SUMMARY:none X-HE-Tag: taste68_10577a0cb070e X-Filterd-Recvd-Size: 6761 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140045.outbound.protection.outlook.com [40.107.14.45]) by imf16.hostedemail.com (Postfix) with ESMTP for ; Fri, 25 Oct 2019 17:55:12 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aLYrM7bAKrZjnFUcyHacM1PikTDae34QGeJuiBk/Jql6buuiK53bcIlYT68RVjnAn1XDzUfhlimz0NZ8S4CTamo8epd5RKdj8GM4uGLr4C5QJUhbAhDyw2UxGk2fIPRuWac5iSYS1t5EorytWLvhMALLLunn3mYIN0YcwfeI2JecQw2ashDUq3LzZnOFTatBnOApn2kCW/R+RCfBP54COIbCXMB3PxLvxgMLOJuTHR8nGctRQSboYrjozim0gss7I8opU+us7i3Ls1xga0VbJSU8v7YVaWykRGKk2F+YsDqLakIkxxMayx4iXuM3DaJyjRkqvYWxPkHI2he268eJKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ND6mJuKPnGzCYk6+sDSZJma2xYL7J0TbCnZBGIebTTc=; b=O9+LnmL+vGc8ab8e8uIAZLJEd+3s24nLTdkge26RFKMSh0aCoQuW4egY4Tge6yV/QW/J9KkJGU6VKNHT0tRQj4jEsJpAgQ2gXi2UxoDcDqMPPcoXlmClQcrssS4cQMZE/T8D78m29rzE3N4hgvLCiLXpD4LkSn6XnhWBXdSR7NhIujDzv1l15UZBcKG3tOlnQhKiiU3xJWnq1Z9T0WpKZyk/E/R8WF/ZOaqYvugHxQIhOC2g7jd7Ua3slEkMv47dqi4xPglVN8S2joiVhu6qdRNGOWLiGoZbbIpljM23ecd4mUsMuQqU/ll32uKw+Q1h33vKNUBwRZgzKFnfusVgMA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ND6mJuKPnGzCYk6+sDSZJma2xYL7J0TbCnZBGIebTTc=; b=grl+/RSy9vonYZ59XA/ZC6YaLwxURL/CCmCGOlXtJVVO8yN/JttVyY1TNoysh6ylDFESMpRc15cMRMz2iDkwVwzK262VYXcmELBGXIFEk+nEUzeGyNZ1L3ciUs/cuMPEpG1hKtUNUIgOF2Cuh+kfPO4hpH4oGL2CS0ErRkrsGv0= Received: from DB7PR05MB4138.eurprd05.prod.outlook.com (52.135.129.16) by DB7PR05MB5480.eurprd05.prod.outlook.com (20.177.192.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.22; Fri, 25 Oct 2019 17:55:09 +0000 Received: from DB7PR05MB4138.eurprd05.prod.outlook.com ([fe80::18c2:3d9e:4f04:4043]) by DB7PR05MB4138.eurprd05.prod.outlook.com ([fe80::18c2:3d9e:4f04:4043%3]) with mapi id 15.20.2387.021; Fri, 25 Oct 2019 17:55:08 +0000 From: Jason Gunthorpe To: "linux-mm@kvack.org" , Andrew Morton CC: Daniel Vetter Subject: [PATCH rc] mm/mmu_notifiers: use the right return code for WARN_ON Thread-Topic: [PATCH rc] mm/mmu_notifiers: use the right return code for WARN_ON Thread-Index: AQHVi11W2ip9w4fcrk2X11m9RclbPw== Date: Fri, 25 Oct 2019 17:55:08 +0000 Message-ID: <20191025175502.GA31127@ziepe.ca> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MN2PR15CA0017.namprd15.prod.outlook.com (2603:10b6:208:1b4::30) To DB7PR05MB4138.eurprd05.prod.outlook.com (2603:10a6:5:23::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=jgg@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [142.162.113.180] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 46a18438-7db4-413a-257b-08d759747941 x-ms-traffictypediagnostic: DB7PR05MB5480: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-forefront-prvs: 02015246A9 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(4636009)(366004)(376002)(346002)(136003)(396003)(39860400002)(189003)(199004)(1076003)(26005)(99286004)(25786009)(71190400001)(256004)(3846002)(316002)(6116002)(305945005)(110136005)(8676002)(81166006)(8936002)(14444005)(66946007)(2501003)(6486002)(14454004)(6436002)(478600001)(7736002)(66066001)(71200400001)(66556008)(4326008)(186003)(81156014)(36756003)(4744005)(5660300002)(52116002)(6506007)(486006)(66446008)(64756008)(9686003)(33656002)(6512007)(386003)(86362001)(66476007)(476003)(2906002)(102836004);DIR:OUT;SFP:1101;SCL:1;SRVR:DB7PR05MB5480;H:DB7PR05MB4138.eurprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: K7Qdg16GI3JRHjIAoD6Ex//OyaJPgzDgX2QnuG4ndB0towFm0tFXmRFGoBik6eoskXpe3jhcq+ByaQfaNNAmExEoWKzJ8FgT4IWXbLJM9vpPRmPONiOyQVBNtJC7LXVLy0kNKV6DLpDwxuudfeJ0uw7jbCiQBWnGpM83IkBNa4S/4G5xU7qRdKo4RDIgOQxbuT8v570wXdXiYSfh6+907BRDI4RO84feSiLD6QfO9wqfH6Mz+9OnpsXCAkZibvy7p865pTCYVnllyiECOHnwpeS1/1wGotIPkpUUc7lszpNFsYsE9+F+qvkapqHTQgwl1xWCFUs5O3Bsa/sGxqi6vrWjfB90WKTK1SC3UxCLi+q+V6MwlneEDhCgqmcBJ6mYBEwPHqyFT66Zu1+GVOMo57gOd521KUi418P8QRw379NmIEKbrkjw3ujh0PPY+d/d x-ms-exchange-transport-forked: True Content-ID: MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 46a18438-7db4-413a-257b-08d759747941 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Oct 2019 17:55:08.6792 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Irl4hJHoPOLYftGmaQEWi19MU8+S395H2+fJyKVm2Mp0jnbFtkzu8vo5PWaqAT3Z7kRvwQkx0Gc+Z9+3tPRCog== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB5480 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The return code from the op callback is actually in _ret, while the WARN_ON was checking ret which causes it to misfire. Fixes: 8402ce61bec2 ("mm/mmu_notifiers: check if mmu notifier callbacks are allowed to fail") Cc: Daniel Vetter Signed-off-by: Jason Gunthorpe --- mm/mmu_notifier.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Andrew, could you forward this to Linus in the -rc stream? This is a new regression in v5.4-rc1, thanks diff --git a/mm/mmu_notifier.c b/mm/mmu_notifier.c index 7fde88695f35d6..9a889e456168bc 100644 --- a/mm/mmu_notifier.c +++ b/mm/mmu_notifier.c @@ -180,7 +180,7 @@ int __mmu_notifier_invalidate_range_start(struct mmu_notifier_range *range) mn->ops->invalidate_range_start, _ret, !mmu_notifier_range_blockable(range) ? "non-" : ""); WARN_ON(mmu_notifier_range_blockable(range) || - ret != -EAGAIN); + _ret != -EAGAIN); ret = _ret; } }