Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2232006pxb; Sat, 2 Oct 2021 10:20:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTSFQu4SwS0skh7v+WWADKsKbpqKF8GwRnnSaNbCZsB1k0MwSCanr8RMf9tUMTGRlB3PPg X-Received: by 2002:a17:906:369a:: with SMTP id a26mr5223186ejc.539.1633195222359; Sat, 02 Oct 2021 10:20:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633195222; cv=none; d=google.com; s=arc-20160816; b=dFRLDSsccf8C2tJjc8c8w4B7hFTkEAz4nMTxq32r+nDZz0ZRIQghkwIKF98M1NdBkI DgXsprtefgWQXO10CmirPvqmYODrp/tu6CV9NdKcqru5Ij0Vj5rGQDLP+VuUDl5yjotP PK1tEWk862BSE+LDqXuaa2bJ68SmYK50Il3SKriC+echbNGv+ypbTR0XphH2C6pMRDeH jT04UGPEHUxGp02ekzAFyLe6RDdLJFtMe9QRFbNT4J4i8UG4vFmFkdCrYzWVHOwc4m97 Djf5b6tPc0iRN5gdsAC5QT3zrkMUDmVDtPW+I8+YhR+eVvutwJTODccIzEtNTBeHS2aV QuWA== 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=PIjjyfrAuUl3SckZYoG4VeimIH7p/90CjZZXmE20Cgo=; b=RsfUSW9AWoe0VM98M+vOYuRgYbfKoQc+Pi3knfV5US7S8sYKGrdDHlMQwOEWXGc9kd XGDz8vssvtwRp+b/KnqE32kEPF9koC9W5K3QvK0qdxlf92FTboijqp+zk0ws61HxZ6Uu sxO8qos4rjKrwsqq4MQa1WHZceNiqNlkjgPb63PTy0S/tRkCcReemZnViXPQHouOJdww Wc1frZ5bp5t1DQZuwwvqG7Svcs4hT4tjQloc90XscWvzQEzLnka2+abCcfT5PSNTZ18U JLsvdxB04Ez3FuTm5PbJ3kgXNo7v32emeARKrWByR8P8eepVYlWshzoFzdtNSohhupFp UdHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="fH/6WcI1"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lr22si2323302ejb.55.2021.10.02.10.19.58; Sat, 02 Oct 2021 10:20:22 -0700 (PDT) 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=@infradead.org header.s=casper.20170209 header.b="fH/6WcI1"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233637AbhJBRLp (ORCPT + 99 others); Sat, 2 Oct 2021 13:11:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233451AbhJBRLo (ORCPT ); Sat, 2 Oct 2021 13:11:44 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11485C0613EC for ; Sat, 2 Oct 2021 10:09:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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; bh=PIjjyfrAuUl3SckZYoG4VeimIH7p/90CjZZXmE20Cgo=; b=fH/6WcI10IRMVg8JQGJ3sJdQnj P1aJ06rry0eCARtlxq4SE6Yf/i3OgdO0okKcobFSGuJrjqlxOi+abXshRyYdDKuplpBukmWxNncEp Yz5jVOGbMzevHDU6ehWfAiNQfR9ajItGJ7EzYCUYY2OLfJ+uTem/KlaoIuBX0GO68oKdZGgRVQydM wA0qvoT9woaDVDlgiQ5HIrvGbs+k5VzMEsq6ZDvczuxC/QernuTPSO0eNY9OY5CcYdQvfOIx2eWJS 91PIK5hbzxvIOxBq+7TrBAQhPcG/HOsP/qv1DhvyJnmIK7JJIA2KF91Le0Z5Up6/azav/L5XRMytM tiECMvKQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mWiV7-00FDsY-J5; Sat, 02 Oct 2021 17:08:49 +0000 Date: Sat, 2 Oct 2021 18:08:41 +0100 From: Matthew Wilcox To: Yang Shi Cc: Hugh Dickins , Song Liu , Rongwei Wang , Andrew Morton , Linux MM , Linux Kernel Mailing List , William Kucharski Subject: Re: [PATCH v2 1/2] mm, thp: check page mapping when truncating page cache Message-ID: References: <67906bf5-4de9-8433-3d70-cc8fc5cc2347@linux.alibaba.com> <3d264ed9-f8fd-60d4-7125-f9f745ebeb52@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 30, 2021 at 10:39:14AM -0700, Yang Shi wrote: > On Thu, Sep 30, 2021 at 9:49 AM Hugh Dickins wrote: > > I assume you're thinking of one of the fuzzer blkdev ones: > > https://lore.kernel.org/linux-mm/CACkBjsbtF_peC7N_4mRfHML_BeiPe+O9DahTfr84puSG_J9rcQ@mail.gmail.com/ > > or > > https://lore.kernel.org/lkml/CACkBjsYwLYLRmX8GpsDpMthagWOjWWrNxqY6ZLNQVr6yx+f5vA@mail.gmail.com/ > > > > I haven't started on those ones yet: yes, I imagine one or both of those > > will need a further fix (S_ISREG() check somewhere if we're lucky; but > > could well be nastier); but for the bug in this thread, I expect > > Makes sense to me. We should be able to check S_ISREG() in khugepaged, > if it is not a regular file, just bail out. Sounds not that nasty to > me AFAIU. I don't see why we should have an S_ISREG() check. I agree it's not the intended usecase, but it ought to work fine. Unless there's something I'm missing?