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 E6E55C2D0E8 for ; Fri, 3 Apr 2020 07:27:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BD79A206F8 for ; Fri, 3 Apr 2020 07:27:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389552AbgDCH1e (ORCPT ); Fri, 3 Apr 2020 03:27:34 -0400 Received: from verein.lst.de ([213.95.11.211]:51430 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730889AbgDCH1e (ORCPT ); Fri, 3 Apr 2020 03:27:34 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 7785668BFE; Fri, 3 Apr 2020 09:27:31 +0200 (CEST) Date: Fri, 3 Apr 2020 09:27:31 +0200 From: Christoph Hellwig To: Ira Weiny Cc: Christoph Hellwig , 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: <20200403072731.GA24176@lst.de> References: <20200309170437.GA271052@iweiny-DESK2.sc.intel.com> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200402205518.GF3952565@iweiny-DESK2.sc.intel.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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. But returning an error and doing a lazy change anyway is straight from the playbook for arcane and confusing API designs.