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 X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 405ABC433E1 for ; Wed, 3 Jun 2020 10:10:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2007620810 for ; Wed, 3 Jun 2020 10:10:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726916AbgFCKKb (ORCPT ); Wed, 3 Jun 2020 06:10:31 -0400 Received: from mx2.suse.de ([195.135.220.15]:47920 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726744AbgFCKK1 (ORCPT ); Wed, 3 Jun 2020 06:10:27 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id BBAB4ABCF; Wed, 3 Jun 2020 10:10:27 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 077581E1281; Wed, 3 Jun 2020 12:10:24 +0200 (CEST) Date: Wed, 3 Jun 2020 12:10:24 +0200 From: Jan Kara To: "Darrick J. Wong" Cc: ira.weiny@intel.com, linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, Al Viro , Jan Kara , Dan Williams , Dave Chinner , Christoph Hellwig , "Theodore Y. Ts'o" , Jeff Moyer , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org Subject: Re: [PATCH V11 11/11] fs/xfs: Update xfs_ioctl_setattr_dax_invalidate() Message-ID: <20200603101024.GG19165@quack2.suse.cz> References: <20200428002142.404144-1-ira.weiny@intel.com> <20200428002142.404144-12-ira.weiny@intel.com> <20200428201138.GD6742@magnolia> <20200602172353.GC8230@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200602172353.GC8230@magnolia> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 02-06-20 10:23:53, Darrick J. Wong wrote: > On Tue, Apr 28, 2020 at 01:11:38PM -0700, Darrick J. Wong wrote: > > > -out_unlock: > > > - xfs_iunlock(ip, XFS_MMAPLOCK_EXCL | XFS_IOLOCK_EXCL); > > > - return error; > > > + if ((mp->m_flags & XFS_MOUNT_DAX_ALWAYS) || > > > + (mp->m_flags & XFS_MOUNT_DAX_NEVER)) > > > + return; > > > > > > + if (((fa->fsx_xflags & FS_XFLAG_DAX) && > > > + !(ip->i_d.di_flags2 & XFS_DIFLAG2_DAX)) || > > > + (!(fa->fsx_xflags & FS_XFLAG_DAX) && > > > + (ip->i_d.di_flags2 & XFS_DIFLAG2_DAX))) > > > + d_mark_dontcache(inode); > > Now that I think about this further, are we /really/ sure that we want > to let unprivileged userspace cause inode evictions? You have to have an equivalent of write access to the file to be able to trigger d_mark_dontcache(). So you can e.g. delete it. Or you could fadvise / madvise regarding its page cache. I don't see the ability to push inode out of cache as stronger than the abilities you already have... Honza -- Jan Kara SUSE Labs, CR