Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1100441yba; Thu, 9 May 2019 10:43:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqxAyaVyRz/Gurb0Jt57zZOWzpl/FZtQpusdWX8PLirHrWbQITn7Jz7GSSAxDfW106LML93J X-Received: by 2002:a17:902:e40f:: with SMTP id ci15mr7131092plb.280.1557423829739; Thu, 09 May 2019 10:43:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557423829; cv=none; d=google.com; s=arc-20160816; b=etRGIw6n+icaMFEUB91Rlu5XF+tLOkpcpg8bwfGYAzXgyKZ759nEcMNhZSPNaJXLPZ HpDGIj4p2zrx9c5165X3Ttf3tLapmhhol0tu8fIzJ3BytDFTvyl6Lvv2S0fX7C7KDAnx Witj1yAYcspxTVwgzGxwyzniO03tWSiBN+Zy663XrxvfJzlo2U6zkOnr8lQ78y07306b dfBfO3Wukf5FxJ9bPXkxvQhNDC0NnVP9fgjOCPkk4WZCx54uD1zL7LFLqWhzDdddUDgr jzBIBLSU+I1sodxcxRwZHSaEn4wqP784BVgfFnaz/PY9ZYN2Gpy3sh1FOoC7jYj8f/co PWsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=SWxiY7wLMkvGzgYZ4dhJCkizwo7IZKg5eY+l4keAF+w=; b=wDRuUhi8JMcG8OmGgUmJt6ezSbXTBp4JlBXHR2oDMh681uYKkMxrABYwSiM+THkcGN 9QaaTCEnLcaUpKDd/qUFlHoCM0KercIncDTrOwxTUMakn7xC5lfXYKsEhDBO57aqxeo2 NmD+jXDd9xZXpQkEMZEk0a09PBIwhwzPI9Nd998r+D4u2loN9iEPg95buOQrSokfYomc KzIvkQeYbp0vfoXkBKwL5zdUKQUtT1QEF0x4IIaHyn18dB4VmEq5F0GQcwfurNOwIBoe IphM9dPyAqfEHsBCYzQfIZBoqlgFSL0qREUa2wvIfzNuZURvNWlAcO0RUDtm++Wecd6U OjpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=A+r+1MhW; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d11si3967399pgj.84.2019.05.09.10.43.33; Thu, 09 May 2019 10:43:49 -0700 (PDT) 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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=A+r+1MhW; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726767AbfEIRmW (ORCPT + 99 others); Thu, 9 May 2019 13:42:22 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:59174 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726666AbfEIRmW (ORCPT ); Thu, 9 May 2019 13:42:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=SWxiY7wLMkvGzgYZ4dhJCkizwo7IZKg5eY+l4keAF+w=; b=A+r+1MhWu/dkRNuFIgEnO64VI MbuTp1uF2SGZIS/b/4+Q9/wkGy8Nb8jCTAu4AqSvvfmbvfCLsn7yuBflpfI4fnGbLfbg2g0iiVcmN zowWbM+NicYMfTiL4lRHtDyOS/Bc5WsOiWTpXdx0l0jkNtyMI6YMzLLCguRIs1HglMamuA61hDuI5 aEjceSgZhHv3m8sQeYir/8gDn0glrdEQtRSvP+DeboAUNaXnkJzr1qjIPkcnsdI5PQEVv6fxLJuP2 8il84ihcOElvpUkBREhm6AqLzH295tN0gomSEbRmxJ8UB6xOGLHnY+napd6YJwhAz/mJU8DmwaJSJ 5en8emtJg==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1hOn3k-0006iG-S4; Thu, 09 May 2019 17:42:20 +0000 Date: Thu, 9 May 2019 10:42:20 -0700 From: Matthew Wilcox To: Dan Williams Cc: akpm@linux-foundation.org, stable@vger.kernel.org, Piotr Balcer , Yan Ma , "Aneesh Kumar K.V" , Chandan Rajendra , Jan Kara , Souptick Joarder , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] mm/huge_memory: Fix vmf_insert_pfn_{pmd, pud}() crash, handle unaligned addresses Message-ID: <20190509174220.GA6235@bombadil.infradead.org> References: <155741946350.372037.11148198430068238140.stgit@dwillia2-desk3.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <155741946350.372037.11148198430068238140.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 09, 2019 at 09:31:41AM -0700, Dan Williams wrote: > diff --git a/drivers/dax/device.c b/drivers/dax/device.c > index e428468ab661..996d68ff992a 100644 > --- a/drivers/dax/device.c > +++ b/drivers/dax/device.c > @@ -184,8 +184,7 @@ static vm_fault_t __dev_dax_pmd_fault(struct dev_dax *dev_dax, > + return vmf_insert_pfn_pmd(vmf, *pfn, vmf->flags & FAULT_FLAG_WRITE); I think we can ditch the third parameter too. Going through the callers ... > @@ -235,8 +234,7 @@ static vm_fault_t __dev_dax_pud_fault(struct dev_dax *dev_dax, > + return vmf_insert_pfn_pud(vmf, *pfn, vmf->flags & FAULT_FLAG_WRITE); > @@ -1575,8 +1575,7 @@ static vm_fault_t dax_iomap_pmd_fault(struct vm_fault *vmf, pfn_t *pfnp, > + result = vmf_insert_pfn_pmd(vmf, pfn, write); This 'write' parameter came earlier from: bool write = vmf->flags & FAULT_FLAG_WRITE; and it is not modified subsequently. > @@ -1686,8 +1685,7 @@ dax_insert_pfn_mkwrite(struct vm_fault *vmf, pfn_t pfn, unsigned int order) > + ret = vmf_insert_pfn_pmd(vmf, pfn, FAULT_FLAG_WRITE); If FAULT_FLAG_WRITE is not set in a mkwrite handler, I don't know what's gone wrong with the world. Even without these changes, Reviewed-by: Matthew Wilcox