From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D581C433FF for ; Fri, 2 Aug 2019 19:26:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CCA7B2086A for ; Fri, 2 Aug 2019 19:26:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="byi/JLB7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404849AbfHBT0l (ORCPT ); Fri, 2 Aug 2019 15:26:41 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:17220 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404439AbfHBT0l (ORCPT ); Fri, 2 Aug 2019 15:26:41 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Fri, 02 Aug 2019 12:26:41 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Fri, 02 Aug 2019 12:26:39 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Fri, 02 Aug 2019 12:26:39 -0700 Received: from [10.2.171.217] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 2 Aug 2019 19:26:39 +0000 Subject: Re: [PATCH 20/34] xen: convert put_page() to put_user_page*() To: "Weiny, Ira" , Juergen Gross , "john.hubbard@gmail.com" , Andrew Morton CC: "devel@driverdev.osuosl.org" , Dave Chinner , Christoph Hellwig , "Williams, Dan J" , "x86@kernel.org" , "linux-mm@kvack.org" , Dave Hansen , "amd-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" , "intel-gfx@lists.freedesktop.org" , "linux-arm-kernel@lists.infradead.org" , "linux-rpi-kernel@lists.infradead.org" , "devel@lists.orangefs.org" , "xen-devel@lists.xenproject.org" , Boris Ostrovsky , "rds-devel@oss.oracle.com" , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Jan Kara , "ceph-devel@vger.kernel.org" , "kvm@vger.kernel.org" , "linux-block@vger.kernel.org" , "linux-crypto@vger.kernel.org" , "linux-fbdev@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , LKML , "linux-media@vger.kernel.org" , "linux-nfs@vger.kernel.org" , "linux-rdma@vger.kernel.org" , "linux-xfs@vger.kernel.org" , "netdev@vger.kernel.org" , "sparclinux@vger.kernel.org" , Jason Gunthorpe References: <20190802022005.5117-1-jhubbard@nvidia.com> <20190802022005.5117-21-jhubbard@nvidia.com> <4471e9dc-a315-42c1-0c3c-55ba4eeeb106@suse.com> <2807E5FD2F6FDA4886F6618EAC48510E79E66216@CRSMSX101.amr.corp.intel.com> X-Nvconfidentiality: public From: John Hubbard Message-ID: <746b2412-f48a-9722-2763-253a1b9c899d@nvidia.com> Date: Fri, 2 Aug 2019 12:25:01 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <2807E5FD2F6FDA4886F6618EAC48510E79E66216@CRSMSX101.amr.corp.intel.com> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL104.nvidia.com (172.18.146.11) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1564774001; bh=rRhheBqnK3+cjDjuz6CHnpsz5YflbO5z8PXp1A2YK5w=; h=X-PGP-Universal:Subject:To:CC:References:X-Nvconfidentiality:From: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=byi/JLB7CNtV06561y8XoJ3SAPfLWvMAReG7pbHQL4vyYMWIeKNh0N7pvRnXFQG1L qdrcKeqyYLdfyHlBvNt3iltX04f4l9yslTmpDdtWvq1t3b7bkuO+rrbkZHys+WsmhV 6Aa9W+8qQAz5X83c7tyDcDc6Mg36wKOuzq27pabbfn+69ez0SBMHEuaNtlKh20Fcaj gTip6LdymKj+uFDjnVTxb7sYVNWRS9rebCu5gBiFOf/CT8TUXKtD/8+Sk9b10OKO7l 1Y0kk6maXEh1JdSy6qqRDc1JYyIdeVQu9Kdnt4cKXn6PzYq3IXSks/FI+pwJb3dRVj 9ZhtT6T5hfRNQ== Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On 8/2/19 9:09 AM, Weiny, Ira wrote: >> >> On 02.08.19 07:48, John Hubbard wrote: >>> On 8/1/19 9:36 PM, Juergen Gross wrote: >>>> On 02.08.19 04:19, john.hubbard@gmail.com wrote: >>>>> From: John Hubbard >>> ... >>> If that's not the case (both here, and in 3 or 4 other patches in this >>> series, then as you said, I should add NULL checks to put_user_pages() >>> and put_user_pages_dirty_lock(). >> >> In this case it is not correct, but can easily be handled. The NULL case can >> occur only in an error case with the pages array filled partially or not at all. >> >> I'd prefer something like the attached patch here. > > I'm not an expert in this code and have not looked at it carefully but that patch does seem to be the better fix than forcing NULL checks on everyone. > OK, I'll use Juergen's approach, and also check for that pattern in the other patches. thanks, -- John Hubbard NVIDIA