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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD5BCC433F5 for ; Sat, 2 Oct 2021 17:09:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2FE6E61B2B for ; Sat, 2 Oct 2021 17:09:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2FE6E61B2B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 3502D6B006C; Sat, 2 Oct 2021 13:09:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2FF8C6B0071; Sat, 2 Oct 2021 13:09:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1EF256B0072; Sat, 2 Oct 2021 13:09:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0033.hostedemail.com [216.40.44.33]) by kanga.kvack.org (Postfix) with ESMTP id 103D16B006C for ; Sat, 2 Oct 2021 13:09:43 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id B65C22771B for ; Sat, 2 Oct 2021 17:09:42 +0000 (UTC) X-FDA: 78652134204.04.F1583A5 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf02.hostedemail.com (Postfix) with ESMTP id 1D7AA7001E2C for ; Sat, 2 Oct 2021 17:09:42 +0000 (UTC) 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: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 1D7AA7001E2C X-Stat-Signature: h9ebqgdkipqprk3a7s6gy53hw5qxmx34 Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="fH/6WcI1"; dmarc=none; spf=none (imf02.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-HE-Tag: 1633194582-536974 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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?