Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp26576360rwd; Mon, 3 Jul 2023 11:35:49 -0700 (PDT) X-Google-Smtp-Source: APBJJlFwh198GiylfqJWfMKkF7B+N5aFP4RDsG8JtD2zV0JRiOfUI6jlFskRqdKdiK01y0bXLrW3 X-Received: by 2002:a17:902:d4d1:b0:1b8:83a3:7db6 with SMTP id o17-20020a170902d4d100b001b883a37db6mr10522662plg.44.1688409349585; Mon, 03 Jul 2023 11:35:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688409349; cv=none; d=google.com; s=arc-20160816; b=B497W6ZUJeSBZ+elHXrwbzTovI6lFgVDR6nq/IAc0kJK05IsKEHZgt9UP85Lux98/y mcKCX8enrWDYqnUzcWj4PzxlDRhYGHPN9E4rks2pjH5sgGxcGzEKjrmobgRmiPKiNB8F cszmcVLq+qCwo9Ya+PDpg9wUozpbQtTDP6S6WZOz0bWFsVUX45irfRqp9Py7AjoE9vJK FOLQkAITdk1eFM2dH3OV2PQtWA/suv7AsgqPZYTG8+dL4ZZqYMz+7z1VcOjbFB3Vhfxd zdiuMcTcNq6IOXE3u/hvSldlcmKC1tsBXxEvc7jrhxGvexHjnOziSDUitYiltLvcFZyN 6pyA== 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=Wjpbye3JJv9NkTmSpEd1ZdQcNW/6M0TApmTiEKcmKzs=; fh=NRKC0a4Dy9exHMrjuZ3klxKF1efWbvmuQJNxiKzFQmo=; b=FnVNC3aGAtoz0p8pPCAiHXvYDu7fBspytL8AjCvp6dMtdT0msJO0ilpl54j9EgsSzV l0ltsbY6RXNvIRcfemuAjzDJ214r7byaIBwYfivqb0u59rAblsM8F7uVWe/xySKFmd1f Ls6hylQDFjHHmh8jTNBlDRViqoUOEG+aK1CSexxsDtdMDbv0rX+OMaplhCoJjuIwY1f2 PX9AUhKb3/eraLEEfu2wF+ImlsXYdphVqCPl/v9jmlXijZiobj5O2cgbEe4NCMH5M1/t QkYRS4SKFeVXlDtHbaACnKw6iTUV/0unwc81UZRTicysjDNIcQ7BO2Bw/fMvDD5agA5+ 2w5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BIqHRpak; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k15-20020a170902c40f00b001aff514a8f0si20741236plk.534.2023.07.03.11.35.35; Mon, 03 Jul 2023 11:35:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BIqHRpak; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230406AbjGCSbL (ORCPT + 99 others); Mon, 3 Jul 2023 14:31:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230137AbjGCSbK (ORCPT ); Mon, 3 Jul 2023 14:31:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A66B9121; Mon, 3 Jul 2023 11:31:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 43EFC60FFA; Mon, 3 Jul 2023 18:31:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5AA58C433C8; Mon, 3 Jul 2023 18:31:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1688409068; bh=WFAyaT1zBQm/iWkDAeWv3kb/dymBVkbMfUBLGKdYW5s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BIqHRpak3i1WBkOOcQxmz4zZdBFnodO6CT37vQwO5m5E+wUrsVrXulKzpa/4z81PD skZl5ufsvgnuzsxzWOY80tKuIx2yNZH+G2KsmvAGu+SIKT0uEgxVftqsCU7JSpk/yh V5ICfyIS94uH0WzUDD2bK4J/+7GBLctk6Lcl6yf0= Date: Mon, 3 Jul 2023 20:31:06 +0200 From: Greg KH To: Sidhartha Kumar Cc: stable@vger.kernel.org, linux-kernel@vger.kernel.org, songmuchun@bytedance.com, mike.kravetz@oracle.com, Ackerley Tng Subject: Re: [PATCH 6.3.y] mm/hugetlb: revert use of page_cache_next_miss() Message-ID: <2023070356-paddling-grip-b31a@gregkh> References: <20230629211817.194786-1-sidhartha.kumar@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230629211817.194786-1-sidhartha.kumar@oracle.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 29, 2023 at 05:18:17PM -0400, Sidhartha Kumar wrote: > commit fd4aed8d985a3236d0877ff6d0c80ad39d4ce81a upstream > > Ackerley Tng reported an issue with hugetlbfs fallocate as noted in the > Closes tag. The issue showed up after the conversion of hugetlb page > cache lookup code to use page_cache_next_miss. User visible effects are: > > - hugetlbfs fallocate incorrectly returns -EEXIST if pages are presnet > in the file. > - hugetlb pages will not be included in core dumps if they need to be > brought in via GUP. > - userfaultfd UFFDIO_COPY will not notice pages already present in the > cache. It may try to allocate a new page and potentially return > ENOMEM as opposed to EEXIST. > > Revert the use page_cache_next_miss() in hugetlb code. > > The upstream fix[2] cannot be used used directly as the return value for > filemap_get_folio() has been changed between 6.3 and upstream. > > Closes: https://lore.kernel.org/linux-mm/cover.1683069252.git.ackerleytng@google.com > Fixes: d0ce0e47b323 ("mm/hugetlb: convert hugetlb fault paths to use alloc_hugetlb_folio()") > Cc: #v6.3 > Reported-by: Ackerley Tng > Signed-off-by: Sidhartha Kumar > > [1] https://lore.kernel.org/linux-mm/cover.1683069252.git.ackerleytng@google.com/ > [2] https://lore.kernel.org/lkml/20230621230255.GD4155@monkey/ > --- > > fs/hugetlbfs/inode.c | 8 +++----- > mm/hugetlb.c | 11 +++++------ > 2 files changed, 8 insertions(+), 11 deletions(-) Now queued up, thanks. greg k-h