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=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 6CB29C33CAA for ; Thu, 23 Jan 2020 03:47:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4A3CA24673 for ; Thu, 23 Jan 2020 03:47:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726061AbgAWDr4 (ORCPT ); Wed, 22 Jan 2020 22:47:56 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:45954 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725933AbgAWDr4 (ORCPT ); Wed, 22 Jan 2020 22:47:56 -0500 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1iuTT7-000yaO-Dr; Thu, 23 Jan 2020 03:47:45 +0000 Date: Thu, 23 Jan 2020 03:47:45 +0000 From: Al Viro To: Omar Sandoval Cc: Amir Goldstein , Trond Myklebust , "dhowells@redhat.com" , "lsf-pc@lists.linux-foundation.org" , "hch@lst.de" , "miklos@szeredi.hu" , "linux-fsdevel@vger.kernel.org" , "Darrick J. Wong" Subject: Re: [LSF/MM/BPF TOPIC] Allowing linkat() to replace the destination Message-ID: <20200123034745.GI23230@ZenIV.linux.org.uk> References: <20200117181730.GO8904@ZenIV.linux.org.uk> <20200117202219.GB295250@vader> <20200117222212.GP8904@ZenIV.linux.org.uk> <20200117235444.GC295250@vader> <20200118004738.GQ8904@ZenIV.linux.org.uk> <20200118011734.GD295250@vader> <20200118022032.GR8904@ZenIV.linux.org.uk> <20200121230521.GA394361@vader> <20200122221003.GB394361@vader> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200122221003.GB394361@vader> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Wed, Jan 22, 2020 at 02:10:03PM -0800, Omar Sandoval wrote: > > Sorry for not reading all the thread again, some API questions: > > - We intend to allow AT_REPLACE only with O_TMPFILE src. Right? > > I wasn't planning on having that restriction. It's not too much effort > for filesystems to support it for normal files, so I wouldn't want to > place an artificial restriction on a useful primitive. I'm not sure; that's how we ended up with the unspeakable APIs like rename(2), after all... Said that, in this particular case I would suggest allowing it for any source - what matters is not the _origin_ of that thing, but the current state. And linkat() (including the already existing variant) can change that at any time...