Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp619768ybb; Fri, 3 Apr 2020 08:49:44 -0700 (PDT) X-Google-Smtp-Source: APiQypK6i0w1cIHlDEOPIpkkqTiKCydK/TOOHkQwY9x7UhmjjMsaVSfS6ybnBDLir1M4ZaOhslLh X-Received: by 2002:a05:6808:355:: with SMTP id j21mr3633052oie.1.1585928984152; Fri, 03 Apr 2020 08:49:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585928984; cv=none; d=google.com; s=arc-20160816; b=jWm3/h6PPzFj7qTvXdtsv/VC0I30MvWzNid0ai/Eq+di2p1DWZYAZy9YEEbk6/wo0C mjKBye1xPo3sE/X9LIRXD0p5zldMYIIqbafUu+PnM9jIQg/mmjc8yUO48fB2LtOQ4YuL lpksfNaGSY0KIgS7k/qnXyeSvo0hlzT0E+yiuFJb5SVanHGkFQVxrOjQfaPcNuQfisfC blRjfMQkHbTPCzCPC14nfMH1mqoWpB+P2DKWTWR57ls+NJ7eQrBBCG7CGffzsakWxIGo 5Hdke0ZEoGTKqc+RwNeQO0VqkOyip2zCCdnxGtGVRBiRECig+jCa9ldUvSUDcVAEEFhN Rrag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=60BXz2Odmiap9ytL+KwPTLMhg0cli//WBHpxWVNBeno=; b=AuqFM0q5gSPECsBJnAqw30kVrvvQdzKmjoxC0E3ibibkuXKK6EGjGbLSPl+Qns13mf n7NjgxTU6Ef/V/CMQbkji2WG+47VhmSnJJkgnPqMm2qyUtHNzI//vVKHDnu7+R4ZWCiw YPlMfVjA6jsKmOF4YxV77O2A74bWJCZ1/Em/iy0i8UlYOxcqOBXDljqfQFCP6QqsR5g2 ZRDKha3bGXXl8kccjblCrz2KCECnDrhXDG6GzwhRxbmNxskynGRnapmKO2/ECSA2Vazv VXotpFyAK+IWC4ST+F6G2xvV+w/eG2NWzQ0C/8OO8aQixmiCzZV5EJBDtHAtNB0xlaiE W5xg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i15si67650ots.121.2020.04.03.08.49.26; Fri, 03 Apr 2020 08:49:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728117AbgDCPsc (ORCPT + 99 others); Fri, 3 Apr 2020 11:48:32 -0400 Received: from mga12.intel.com ([192.55.52.136]:63004 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390961AbgDCPs3 (ORCPT ); Fri, 3 Apr 2020 11:48:29 -0400 IronPort-SDR: +cm6KxcsVqXcpJym4XiAEOQX1UnV6VdN1TAo8Ebm2WccGQiEYzQHwTi97q4HRn+RK5FSMWpvHN UGxn7GCApQ7A== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Apr 2020 08:48:29 -0700 IronPort-SDR: ZXmfRSMQd94WvJqmsBYTXypFkx/d2A0QL6wEIdSitKSObwXXiefBliL2qHOBmf5p/n0SmgtCTn iqQ2h2nMcR5Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,340,1580803200"; d="scan'208";a="285157139" Received: from iweiny-desk2.sc.intel.com ([10.3.52.147]) by fmsmga002.fm.intel.com with ESMTP; 03 Apr 2020 08:48:29 -0700 Date: Fri, 3 Apr 2020 08:48:29 -0700 From: Ira Weiny To: Christoph Hellwig Cc: Jan Kara , "Darrick J. Wong" , Dave Chinner , "Theodore Y. Ts'o" , Dan Williams , Linux Kernel Mailing List , Alexander Viro , linux-ext4 , linux-xfs , linux-fsdevel , Andrew Morton , Linus Torvalds Subject: Re: [PATCH V5 00/12] Enable per-file/per-directory DAX operations V5 Message-ID: <20200403154828.GJ3952565@iweiny-DESK2.sc.intel.com> References: <20200311033614.GQ1752567@magnolia> <20200311062952.GA11519@lst.de> <20200316095224.GF12783@quack2.suse.cz> <20200316095509.GA13788@lst.de> <20200401040021.GC56958@magnolia> <20200401102511.GC19466@quack2.suse.cz> <20200402085327.GA19109@lst.de> <20200402205518.GF3952565@iweiny-DESK2.sc.intel.com> <20200403072731.GA24176@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200403072731.GA24176@lst.de> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Apr 03, 2020 at 09:27:31AM +0200, Christoph Hellwig wrote: > On Thu, Apr 02, 2020 at 01:55:19PM -0700, Ira Weiny wrote: > > > I'd just return an error for that case, don't play silly games like > > > evicting the inode. > > > > I think I agree with Christoph here. But I want to clarify. I was heading in > > a direction of failing the ioctl completely. But we could have the flag change > > with an appropriate error which could let the user know the change has been > > delayed. > > > > But I don't immediately see what error code is appropriate for such an > > indication. Candidates I can envision: > > > > EAGAIN > > ERESTART > > EUSERS > > EINPROGRESS > > > > None are perfect but I'm leaning toward EINPROGRESS. > > I really, really dislike that idea. The whole point of not forcing > evictions is to make it clear - no this inode is "busy" you can't > do that. A reasonably smart application can try to evict itself. I don't understand. What Darrick proposed would never need any evictions. If the file has blocks allocated the FS_XFLAG_DAX flag can not be changed. So I don't see what good eviction would do at all. > > But returning an error and doing a lazy change anyway is straight from > the playbook for arcane and confusing API designs. Jan countered with a proposal that the FS_XFLAG_DAX does change with blocks allocated. But that S_DAX would change on eviction. Adding that some eviction ioctl could be added. You then proposed just returning an error for that case. (This lead me to believe that you were ok with an eviction based change of S_DAX.) So I agreed that changing S_DAX could be delayed until an explicit eviction. But, to aid the 'smart application', a different error code could be used to indicate that the FS_XFLAG_DAX had been changed but that until that explicit eviction occurs S_DAX would remain. So I don't fully follow what you mean by 'lazy change'? Do you still really, really dislike an explicit eviction method for changing the S_DAX flag? If FS_XFLAG_DAX can never be changed on a file with blocks allocated and the user wants to change the mode of operations on their 'data'; they would have to create a new file with the proper setting and move the data there. For example copy the file into a directory marked FS_XFLAG_DAX==true? I'm ok with either interface as I think both could be clear if documented. Jan? Ira