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.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 AA7C9C433DF for ; Tue, 2 Jun 2020 23:15:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 891AA20679 for ; Tue, 2 Jun 2020 23:15:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728501AbgFBXPM (ORCPT ); Tue, 2 Jun 2020 19:15:12 -0400 Received: from mga03.intel.com ([134.134.136.65]:57326 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726977AbgFBXPL (ORCPT ); Tue, 2 Jun 2020 19:15:11 -0400 IronPort-SDR: +yXGausVvQonlRJjYFNgJZe4YKcSALxXM9n3JD5uSKZGsHqntXxNZ8u4EGmsMSxpRtDzEJY4IL avCFhDf1YEKg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2020 16:15:10 -0700 IronPort-SDR: VFcvTWOtbz3dkiPRuW2/npw0KipzrpAkLGxUts2YewEMQROQ4Rd+aVaZH1ioqP86z6ajt4JZpo vq36BdR9KjCg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,466,1583222400"; d="scan'208";a="312421829" Received: from iweiny-desk2.sc.intel.com ([10.3.52.147]) by FMSMGA003.fm.intel.com with ESMTP; 02 Jun 2020 16:15:10 -0700 Date: Tue, 2 Jun 2020 16:15:10 -0700 From: Ira Weiny To: "Darrick J. Wong" Cc: 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: <20200602231510.GH1505637@iweiny-DESK2.sc.intel.com> 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.11.1 (2018-12-01) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Tue, Jun 02, 2020 at 10:23:53AM -0700, Darrick J. Wong wrote: > On Tue, Apr 28, 2020 at 01:11:38PM -0700, Darrick J. Wong wrote: > > On Mon, Apr 27, 2020 at 05:21:42PM -0700, ira.weiny@intel.com wrote: > > > From: Ira Weiny > > > ... > > > -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? This code only applies to files they have access to. And it does not directly cause an eviction. It only hints that those inodes (for which they have access to) will not be cached thus causing them to be reloaded sooner than they might otherwise be. So I think we are fine here. Ira > > --D >