Received: by 10.223.176.5 with SMTP id f5csp821130wra; Sat, 3 Feb 2018 11:03:35 -0800 (PST) X-Google-Smtp-Source: AH8x2258H9OYp2lihYv35lh9MF0zMeYZXhzYJVzrN4lWAAP7H2/QrGoxESlOC+jfRmZC1JNCNdhR X-Received: by 10.98.201.199 with SMTP id l68mr44268862pfk.199.1517684615340; Sat, 03 Feb 2018 11:03:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517684615; cv=none; d=google.com; s=arc-20160816; b=JpdujLkFBmPk7z9pLDMYbkjdR1DuQ+Z2j5ebxtj81dNa8URCN331meatF9qqNZoPkB vtMJQrMwTbqUXt+tOgaevnV3Mt0vyGqpOIH131z1VMz2eN7vxMv+4+Z/71m54xopj1lA Cen3GCh5Jkw8paKyXQxC1DI0ZD+ezLfdfPCYxFcAweLA6JL0W9PNP+7TpwDnPirFIjL8 P4J6B6DxDzi3n7b1Ww6YodxuEneDGX0DMks/XgUf3a/qFqxAiCMTpFdBnTcokJbVGEa4 WkAFQ9y9UgfAapiosqnBMABFuBM7WNlcyUCK7VOa+DUPjM9pKgWDndBfUT0+W6cT8ouk EFUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=TS6pUhKF1HHsWCdH4b06t0BVZzoh8QGABmkZb+n6Jfw=; b=I7WK2akBwj+BSqsP0MSLc9ShVjZGrfJ1e5rk5u8tfTxejfCkGrhm1tUBoRvZjTEi/j 4pCkBsdUW3xiv8I2mC1roEgZL847P2pK1coIqOQDlJ9t4DXq9GKu3ze1L0KCYwTF2kT8 trm5OYwwE+Gpf+BuC9cu0e4+dubVzZ033usFeo8L4SzbEYGGB5bmw/rOhjt8w9ukMHsr nZgmyAU/+Syxk8E+JYdoJ5c55MbuXyPrJBnGY5oIYK8QEAJiWp73MzSdVp9ZYrlr4yL2 BYR5geAV/ftxSZ64rm8yVjtqmqVoqkD9yx7St9PNmgdg7N50SvcRqAvpne009huEjhbg W8rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Zb9YUCD2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b10-v6si3480333plx.696.2018.02.03.11.03.18; Sat, 03 Feb 2018 11:03:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Zb9YUCD2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752772AbeBCSAr (ORCPT + 99 others); Sat, 3 Feb 2018 13:00:47 -0500 Received: from mail-co1nam03on0122.outbound.protection.outlook.com ([104.47.40.122]:24267 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752538AbeBCSAa (ORCPT ); Sat, 3 Feb 2018 13:00:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=TS6pUhKF1HHsWCdH4b06t0BVZzoh8QGABmkZb+n6Jfw=; b=Zb9YUCD25pJ6YpC8BrKrvLi0RUSceOtDLwab+A/8aL0osM0E3ufRT0kRFv1+6Tx8NCyW9g2Dx55rbeewSGjuQERF/KD/npMBU1yPoRUojamXQ74+YFCKPaWeYoEcsMUhh1LhRK21WMkafwEx+nJl6jwB+gOwGzGxWVrO+SLpMG8= Received: from BL0PR2101MB1027.namprd21.prod.outlook.com (52.132.20.161) by BL0PR2101MB1043.namprd21.prod.outlook.com (52.132.24.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.506.3; Sat, 3 Feb 2018 18:00:28 +0000 Received: from BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9]) by BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9%3]) with mapi id 15.20.0485.006; Sat, 3 Feb 2018 18:00:28 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Christophe JAILLET , Dan Williams , Christian Borntraeger , David Sterba , Greg Kroah-Hartman , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 003/110] mm/frame_vector.c: release a semaphore in 'get_vaddr_frames()' Thread-Topic: [PATCH AUTOSEL for 4.14 003/110] mm/frame_vector.c: release a semaphore in 'get_vaddr_frames()' Thread-Index: AQHTnRjfdOtBMkTpwUi+kJ9BH44k4w== Date: Sat, 3 Feb 2018 18:00:27 +0000 Message-ID: <20180203180015.29073-3-alexander.levin@microsoft.com> References: <20180203180015.29073-1-alexander.levin@microsoft.com> In-Reply-To: <20180203180015.29073-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BL0PR2101MB1043;6:rlAy0YUOAIAeday04WWn3JLgl9bxZUg2BZn71oF5u8hGtO0XTH/e3rjRzsOQscNL0RcMBgIK/XXTXcDWdbVIMxZwvawze873LJ5h+MNrU4m/on1Eqa9lSXz85I4lNWN88oMbH6s+ytz7QVERReFCkwjktLkx9W1l3xPIlItUeSIyrIucs0BHzarrbMnXoUoo0Ti92UHkLjSXmWed9f2K+OcaAh6ynbd6uek0KDyD6CjGrLKeFmY8VJAd6UuXGZdxGbiti6hOQpExoHiDRWcXRkUbgjru+FqGYZHelIdZ4lZwkhhcpi7CdsD2w7l/E0WnQOij7I7yCkp2Qtlzj/QXcEj0iRWB4ypraN6tODkSK3evWrtBG7IT4PPU7CenFbnm;5:4XMUhUJOFT6cXnT3/sPDZab3JRWKY9GhOsASK4hFHcbnQVqwyV1rNo9ESOIrFnFekGSJb9pgxe+Q0yRjT+LaimyZu7L4qdkSmfqMGMMc455Nm1nvgbm70adGr4HpRPSAFtTJ4uuNY3H1UgOwDDDEFvgrRWFNHPZw40nP+LzA9mU=;24:49wyCs3fmRrKgxlom5p+hPUtXJHT3/Kf7QxG3kMDz284MWtGSAqKXSmS4k8NzG8jPMdN5dKzB0lIewpcfaNVOfw5b8DZW+9QZt4UGqFCSi8=;7:3pmwF0qNst24YX1+hRdZ32ZSmX6wXngefbZCNVoE56wkEp7T2R1iAYia227+0z6PXfUGibiyVHM+fcH+MJyc7a1zY40RsdZvd09wV1eZvevTf89zaXwAbcLAz6JCSRnSHEJq7E+2HZ0ON9gAgon0EfeinD7kl9A4jNiXYbsXQpiH59SsFlj6h3/E/nCRLN+BV3fjBxX4p6gxEfSn97VBFRTp9n4nNgZgrbBb2JTUbXxkwftAC3o4DmWhlNXXDZEW x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI;SCL:-1;SFV:NSPM;SFS:(10019020)(39380400002)(376002)(39860400002)(366004)(346002)(396003)(189003)(199004)(10290500003)(186003)(6486002)(14454004)(1076002)(102836004)(6306002)(6506007)(76176011)(26005)(6346003)(66066001)(10090500001)(5250100002)(36756003)(6512007)(2501003)(110136005)(99286004)(966005)(54906003)(478600001)(53936002)(72206003)(6436002)(316002)(305945005)(7736002)(2950100002)(2906002)(5660300001)(4326008)(106356001)(575784001)(86362001)(97736004)(25786009)(22452003)(2900100001)(3846002)(107886003)(8676002)(8936002)(6116002)(3280700002)(105586002)(81156014)(81166006)(3660700001)(86612001)(68736007)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:BL0PR2101MB1043;H:BL0PR2101MB1027.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: bae1efea-503a-40c5-39be-08d56b300240 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7193020);SRVR:BL0PR2101MB1043; x-ms-traffictypediagnostic: BL0PR2101MB1043: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(190383065149520)(155761271638844)(42068640409301)(104084551191319)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040501)(2401047)(5005006)(8121501046)(3231101)(2400082)(944501161)(93006095)(93001095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(6072148)(201708071742011);SRVR:BL0PR2101MB1043;BCL:0;PCL:0;RULEID:;SRVR:BL0PR2101MB1043; x-forefront-prvs: 05724A8921 received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: V3gIr8iKnCZfH2zjssCVQntC8cmN1tL1YtX2ff2ml3VkuOdyYZr0mUhe3juMUdi8o8IaYQUG6BKJcQItWiCNfw== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: bae1efea-503a-40c5-39be-08d56b300240 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Feb 2018 18:00:27.1752 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR2101MB1043 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe JAILLET [ Upstream commit 1f704fd0d14043e76e80f6b8b2251b9b2cedcca6 ] A semaphore is acquired before this check, so we must release it before leaving. Link: http://lkml.kernel.org/r/20171211211009.4971-1-christophe.jaillet@wan= adoo.fr Fixes: b7f0554a56f2 ("mm: fail get_vaddr_frames() for filesystem-dax mappin= gs") Signed-off-by: Christophe JAILLET Acked-by: Michal Hocko Cc: Dan Williams Cc: Christian Borntraeger Cc: David Sterba Cc: Greg Kroah-Hartman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- mm/frame_vector.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mm/frame_vector.c b/mm/frame_vector.c index 297c7238f7d4..c64dca6e27c2 100644 --- a/mm/frame_vector.c +++ b/mm/frame_vector.c @@ -62,8 +62,10 @@ int get_vaddr_frames(unsigned long start, unsigned int n= r_frames, * get_user_pages_longterm() and disallow it for filesystem-dax * mappings. */ - if (vma_is_fsdax(vma)) - return -EOPNOTSUPP; + if (vma_is_fsdax(vma)) { + ret =3D -EOPNOTSUPP; + goto out; + } =20 if (!(vma->vm_flags & (VM_IO | VM_PFNMAP))) { vec->got_ref =3D true; --=20 2.11.0