Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2465020pxb; Tue, 23 Feb 2021 07:42:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJwn/n6M9AQ7uSpVAyc3KYRFEpkFBG1dKZALcz5tqbn89A9aqsdKlXc7jJSKNCL/Ql+EHau7 X-Received: by 2002:aa7:d41a:: with SMTP id z26mr16200925edq.359.1614094938977; Tue, 23 Feb 2021 07:42:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614094938; cv=none; d=google.com; s=arc-20160816; b=beSuYHlB/g43xpYzmUG3Yfjj6HJWpo/Nq7DcNVXdl1TPPhGQv9djabuSjGwORBIP1E 30IPTIuoqxB2WNbtwv1k64VU9zWXZp1nfBUzljrjHqRMKx1Q3HaRMLuVD2xyPU4NtuXF yTvdjYfCIUOHfYQ/qbIJHJDclp+ZaifNu1LgQ6c12WhtnfqqQyr1kDyYQF1chDrzsDqY mdupTxsTTXzQIi920q7mUTftVf+cKrb5JD2PsT15VU2ShZ6YJjTzZPhy5FWrecY3mSWz t+JOA3pL7UQ8iqIPNEAsAb1zSJpz1SD3a7oM75hoJDNVgGD5joFAqJazd9fhqSda/ffr WUow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mEc8q6U0PvZdpT9f0rmyiAzpeP08z6HF0GSvezKfJ4M=; b=d+uJRdwBEq1ohAYtEX9MhmhFQIlovEQ23jhDmteh92BTW9yho83m+kGLgs67aiZ6Vw +O1NMPQprqkHsHCDJzJXdXvHNrJLwY6qNpguUOtBpppz3IeyII1LIICE+mphvy3lc9M1 UI/YN6245ybQrPd7WrCkD72A2NdDBeFxXB39qAnT8j0hgsI2F/CuFE3Fx9ZA9ftZ022Q ORGxnrZziT2YYg6MdsA//l/JpLWtS0XnyQG9sKaCU0cXIDQBBb50OzJnNnQ2q9QxAl7m vgtt1yk988hbi0hA118BAox0+9hYc6Bpr/KA/xq49m+4ukTEuyBraFmXxdI+YNlFr3TN n0Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YM705sqy; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t10si13661638edy.247.2021.02.23.07.41.54; Tue, 23 Feb 2021 07:42:18 -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=@redhat.com header.s=mimecast20190719 header.b=YM705sqy; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233236AbhBWPkR (ORCPT + 99 others); Tue, 23 Feb 2021 10:40:17 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:36757 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232813AbhBWPkP (ORCPT ); Tue, 23 Feb 2021 10:40:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614094726; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=mEc8q6U0PvZdpT9f0rmyiAzpeP08z6HF0GSvezKfJ4M=; b=YM705sqy+c+JLALBQsOLifvJZckEcEAFs308XTSI7jUhM6tQsjaYjhUkifXmro6le9Nuri zAn7ZnxMX8wJvciUT9mhtOa/MF0Y/Jt6k4lf8ID0ubGa/C1Vx6UkML77vcDA07WQMUw9s1 N3OfddGOGXgKg+w4hypzwaFEpUCXfBk= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-333-Kn4K54LNN4WZDybizophOg-1; Tue, 23 Feb 2021 10:38:43 -0500 X-MC-Unique: Kn4K54LNN4WZDybizophOg-1 Received: by mail-qt1-f197.google.com with SMTP id h13so6374964qti.21 for ; Tue, 23 Feb 2021 07:38:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=mEc8q6U0PvZdpT9f0rmyiAzpeP08z6HF0GSvezKfJ4M=; b=Pj318g4Yh7jhiBQtZ6AzRDshMcp5xpTZeDogvOwmnBS00lhF3Ynt7tjLOaSz7PQajp 747p/TGWGcNEMBj67YpcNSL9Dqq79urJrOLB1Y+PzBLpzz1os4Bm505WqMtLQZ+Z9V22 U+9J7nON5apzKxKO0m17EDRgyRVpNIFj5OhCYeKvf3i+HXVX8eYnmremOWwLrZbnc1Nj /0gNSA7ASb+GNgeOEPgLJ3GZYIr/HGix04mOp/gR4IacheYiNhzJw6CAx2ETnl+G4hPO r5jwmiTD1Z+nWRvMv6LqMoGbuNQ7hELXjnAg7EJXi5G/mnaIMl7d1qdjMdwOdz6TxDnl iSJg== X-Gm-Message-State: AOAM531au/EaPAMZqeS0+iWRB36n0CET7FEO2pJEv4WSBD4iQ1mo1wb/ RRW8AaJeng1ep3A/h/VAAZkwZ+t5TwsOchrYyjP5bFr+sSJtVmoeNDZ47yKj/eBYkuz1gVPO2Kn mGQOBWaIUrn2eXKsrxLYi1PBA X-Received: by 2002:ac8:100c:: with SMTP id z12mr25023837qti.57.1614094723046; Tue, 23 Feb 2021 07:38:43 -0800 (PST) X-Received: by 2002:ac8:100c:: with SMTP id z12mr25023799qti.57.1614094722794; Tue, 23 Feb 2021 07:38:42 -0800 (PST) Received: from xz-x1 (bras-vprn-toroon474qw-lp130-25-174-95-95-253.dsl.bell.ca. [174.95.95.253]) by smtp.gmail.com with ESMTPSA id y15sm308813qth.52.2021.02.23.07.38.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Feb 2021 07:38:42 -0800 (PST) Date: Tue, 23 Feb 2021 10:38:40 -0500 From: Peter Xu To: Axel Rasmussen Cc: Alexander Viro , Alexey Dobriyan , Andrea Arcangeli , Andrew Morton , Anshuman Khandual , Catalin Marinas , Chinwen Chang , Huang Ying , Ingo Molnar , Jann Horn , Jerome Glisse , Lokesh Gidra , "Matthew Wilcox (Oracle)" , Michael Ellerman , Michal =?utf-8?Q?Koutn=C3=BD?= , Michel Lespinasse , Mike Kravetz , Mike Rapoport , Nicholas Piggin , Shaohua Li , Shawn Anastasio , Steven Rostedt , Steven Price , Vlastimil Babka , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Adam Ruprecht , Cannon Matthews , "Dr . David Alan Gilbert" , David Rientjes , Mina Almasry , Oliver Upton Subject: Re: [PATCH v7 4/6] userfaultfd: add UFFDIO_CONTINUE ioctl Message-ID: <20210223153840.GB154711@xz-x1> References: <20210219004824.2899045-1-axelrasmussen@google.com> <20210219004824.2899045-5-axelrasmussen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210219004824.2899045-5-axelrasmussen@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 18, 2021 at 04:48:22PM -0800, Axel Rasmussen wrote: > @@ -4645,8 +4646,18 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, > spinlock_t *ptl; > int ret; > struct page *page; > + int writable; > > - if (!*pagep) { > + mapping = dst_vma->vm_file->f_mapping; > + idx = vma_hugecache_offset(h, dst_vma, dst_addr); > + > + if (is_continue) { > + ret = -EFAULT; > + page = find_lock_page(mapping, idx); > + *pagep = NULL; Why set *pagep to NULL? Shouldn't it be NULL always?.. If that's the case, maybe WARN_ON_ONCE(*pagep) suite more. Otherwise the patch looks good to me. Thanks, -- Peter Xu