Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp234640rwb; Thu, 22 Sep 2022 17:21:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM66eSY6YkgJI4JP9uKw8Bb96anrVH6PkfwthLmfHadkjWJbtcGgF1lvj1bD75qkJcPpLQa+ X-Received: by 2002:a05:6402:50d4:b0:451:bf26:8c41 with SMTP id h20-20020a05640250d400b00451bf268c41mr5872483edb.219.1663892494786; Thu, 22 Sep 2022 17:21:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663892494; cv=none; d=google.com; s=arc-20160816; b=kuIJ4PhOXFMtm66SA+RJH3AfWCfbjfCCMLg+ZGrq0kSmcfeCcC63lqY/dXvTjGvrnS NRn7w4uNjCD1FLuLJN8xZ5GyHnArCVPOGOHHfAH0hWN/h4kJw5BuZXOgAdrJlWuPHwgP fuz1ru5luxl6wmvsL+nLzLyQkaYl0X6rGrEDnlfjg7B4le8MU4irWbITmMI0+GQ0CKy+ LxgJY7LoHgrxb/RFXw+66rk/Ey0whATRN/lGRw5ccIp5kbEKdEJ73bNEnKXJOGQUig0G dDzFyekmxo8vjMiD6QBpezVNH+mVXZOuahTdZTqQiXpRB5JZ3IpQIcDdaUQUGRWuJA/D 8dMA== 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; bh=yzT9NWTTlJk3hsLXFurDSyuc3aMr2jb4vYQ+59yP9OQ=; b=BGYoIgAi7TxN1xBx7e0H67tr1BpgLU/gbHX3togspi8b9g+KApA0qm9dVPLGq7rCcK AaYFxCd+qWE7UOgLDf0ZIq0Hh+Pf/+9xyRpymx1MtuPk1dQ1+HoKogSMlS6mJilOi9LV fQHlkBmszpbNVt6Ppm3HnY+ucxIZ3G/OFvB/HJYQNYMIPVr3M2UsY537wtEqBPEjJBJR fYfbR4//gOObIXM6S/ECXbRDhIokUzWq3ALYYYa5D+33QlNkaeT5w2jP7EWXH06lxRFq O+xxEpEi5e/KlePaRH9JJ0mI0pxEYiId0vPaq9orIb8AwxH7AhcDTga/XwR87sT0M1k2 /bFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bt10-20020a0564020a4a00b00448c8237904si5927186edb.73.2022.09.22.17.21.01; Thu, 22 Sep 2022 17:21:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229914AbiIWASw (ORCPT + 99 others); Thu, 22 Sep 2022 20:18:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230102AbiIWASv (ORCPT ); Thu, 22 Sep 2022 20:18:51 -0400 Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 131A22AE; Thu, 22 Sep 2022 17:18:51 -0700 (PDT) Received: from dread.disaster.area (pa49-181-106-210.pa.nsw.optusnet.com.au [49.181.106.210]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id E8D961100D8A; Fri, 23 Sep 2022 10:18:47 +1000 (AEST) Received: from dave by dread.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1obWP0-00AzJe-Gk; Fri, 23 Sep 2022 10:18:46 +1000 Date: Fri, 23 Sep 2022 10:18:46 +1000 From: Dave Chinner To: Jason Gunthorpe Cc: Dan Williams , akpm@linux-foundation.org, Matthew Wilcox , Jan Kara , "Darrick J. Wong" , Christoph Hellwig , John Hubbard , linux-fsdevel@vger.kernel.org, nvdimm@lists.linux.dev, linux-xfs@vger.kernel.org, linux-mm@kvack.org, linux-ext4@vger.kernel.org Subject: Re: [PATCH v2 05/18] xfs: Add xfs_break_layouts() to the inode eviction path Message-ID: <20220923001846.GX3600936@dread.disaster.area> References: <166329930818.2786261.6086109734008025807.stgit@dwillia2-xfh.jf.intel.com> <166329933874.2786261.18236541386474985669.stgit@dwillia2-xfh.jf.intel.com> <20220918225731.GG3600936@dread.disaster.area> <632894c4738d8_2a6ded294a@dwillia2-xfh.jf.intel.com.notmuch> <20220919212959.GL3600936@dread.disaster.area> <6329ee04c9272_2a6ded294bf@dwillia2-xfh.jf.intel.com.notmuch> <20220921221416.GT3600936@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.4 cv=VuxAv86n c=1 sm=1 tr=0 ts=632cfb6a a=j6JUzzrSC7wlfFge/rmVbg==:117 a=j6JUzzrSC7wlfFge/rmVbg==:17 a=kj9zAlcOel0A:10 a=xOM3xZuef0cA:10 a=7-415B0cAAAA:8 a=mUMTuxm4VeeAs60aVCsA:9 a=CjuIK1q_8ugA:10 a=biEYGPWJfzWAr4FL6Ov7:22 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE 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-ext4@vger.kernel.org On Wed, Sep 21, 2022 at 07:28:51PM -0300, Jason Gunthorpe wrote: > On Thu, Sep 22, 2022 at 08:14:16AM +1000, Dave Chinner wrote: > > > Where are these DAX page pins that don't require the pin holder to > > also hold active references to the filesystem objects coming from? > > O_DIRECT and things like it. O_DIRECT IO to a file holds a reference to a struct file which holds an active reference to the struct inode. Hence you can't reclaim an inode while an O_DIRECT IO is in progress to it. Similarly, file-backed pages pinned from user vmas have the inode pinned by the VMA having a reference to the struct file passed to them when they are instantiated. Hence anything using mmap() to pin file-backed pages (i.e. applications using FSDAX access from userspace) should also have a reference to the inode that prevents the inode from being reclaimed. So I'm at a loss to understand what "things like it" might actually mean. Can you actually describe a situation where we actually permit (even temporarily) these use-after-free scenarios? Cheers, Dave. -- Dave Chinner david@fromorbit.com