Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp32845imm; Mon, 4 Jun 2018 12:29:18 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKiJCXEy5QbCHAHS0CPf837W5WV6hKqolXsV4Y6Uyr/5M7+pQSodTd3eRZ+VTlId/umUtNB X-Received: by 2002:a65:6690:: with SMTP id b16-v6mr18215421pgw.326.1528140558622; Mon, 04 Jun 2018 12:29:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528140558; cv=none; d=google.com; s=arc-20160816; b=ayUTKHQY0q9XiOFrNrvVrGW5mr/t5y1KY+UtrB97CsGEV6hj7hDFtgqzv/BxI0BESz CuagV0zEZkz5emNBW62x85I70sBPzPhRWlxBlWfNJjBWJuvr0UtXHKp8HvGoIRyu9tva RY9qAfXvnulex0caLPraytbS5QWnOBNfJERy57hM6Icr0mVrD+fHsJUKkTeZr6uG7zBd OhpL2CDtV1jXp6sYjGplkuOIc+CFdpX4GvAwmeSICBuGbJVmjuZMU37NsWFCnc8iS/7S B6osR5eU4AwE9LuYbZmhxMgD7dvpmIJvroxu1EeMTf2uLgmwe16fHdAH8UawHWMzh3eQ HSSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=lmDeDQ45RvnqPTlABLetScI5MO0sYSDb2y2DEVAVTkQ=; b=s7Yx5aqbUbyDPqW3HUKhp5Jvyko9X+/GBgyYIrA6bOMhUvlYJBRvUtyCMwh71LYn4y DnXRpnh902SplwNl6h/ziQ8l1XzZco2b9c0c+juShl48XJxiI81Ro8ShSTWvwhydjmiu TkUXsZbB2XMLveJnfaELwPUkgx98jv93LKXOKM/R70fazRjuil4WbEtpeY9/SA2Xt4w0 /MHjqpHScHdPllhTMKtsznF+zot13KZfcwNL/vd9XfITkpLEUbn66v3F3uWDV21iU4B5 R//C42UOdq8D+7I8+ZHD9+wbT97fwQQwWo7LF5RKRhzjVK3YKFIwzON7Q4teb2V8PwCo bBQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=XRxXCI9Q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33-v6si48193540plg.260.2018.06.04.12.29.04; Mon, 04 Jun 2018 12:29:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=XRxXCI9Q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751364AbeFDT12 (ORCPT + 99 others); Mon, 4 Jun 2018 15:27:28 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:45341 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750999AbeFDT10 (ORCPT ); Mon, 4 Jun 2018 15:27:26 -0400 Received: by mail-oi0-f67.google.com with SMTP id b130-v6so29454166oif.12 for ; Mon, 04 Jun 2018 12:27:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=lmDeDQ45RvnqPTlABLetScI5MO0sYSDb2y2DEVAVTkQ=; b=XRxXCI9Qi+hr7TSjWmYWHYS4L0uObrzKfYc6sto0fxm5tBcdP/G4s+JqPamrkmMaiM rnpSYHEU7+2VurM9YoBBMCXAIo3FrO80gujfcS4+q6Cijbvvf8r6Cy3s7q6H+9D7TocN +csIy/CWjlEns2UxF99EkgUR0xVfgX22+QhyM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=lmDeDQ45RvnqPTlABLetScI5MO0sYSDb2y2DEVAVTkQ=; b=rRJYeiLiouAO3b3I+TAPSh/9WtLcdhIsRWlA2pQ+Jrk16jIoYUF6d2D15Hyahg83RY RkWlEsi1wNkT/414nq2BAjL9fvoIGhj+0qViDm20bxfdx3iFT8RfS3UIb8tOKthr2yL9 itNPr2x0X6Y2IRLSmmIWdP46+cbQZZzx9LaAmQxcj1ti86Pzaoz+WD12H7qURaaeQY84 dt5UEv/QWe8Za28axwSOsoefltH51FBD7sEtZkVuEzRH3GY0fRhxTFFEZySV/IGcpIRD t1WmgKCa1W8krCwfns1R+GR04P0228nld0zDL/dTa4crWSNroC+ZA4ftnauthQVqGUr2 lDhg== X-Gm-Message-State: ALKqPweDVokBqb8FkzCmfjRK1D7QYgFvHG2t6O/z3rHKKHzVr9f5kRyA lZ0+Wo/6vYSRzBgpuK46hXWETVzGeUKbziIFG1WsnuG1 X-Received: by 2002:aca:4205:: with SMTP id p5-v6mr13099733oia.13.1528140445867; Mon, 04 Jun 2018 12:27:25 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:1123:0:0:0:0:0 with HTTP; Mon, 4 Jun 2018 12:27:24 -0700 (PDT) X-Originating-IP: [176.63.54.97] In-Reply-To: <20180604155205.GH30522@ZenIV.linux.org.uk> References: <152720672288.9073.9868393448836301272.stgit@warthog.procyon.org.uk> <152720691829.9073.10564431140980997005.stgit@warthog.procyon.org.uk> <20180601062654.GA32397@infradead.org> <7067.1527841663@warthog.procyon.org.uk> <20180602030913.GU30522@ZenIV.linux.org.uk> <20180602034255.GV30522@ZenIV.linux.org.uk> <21804.1527954321@warthog.procyon.org.uk> <20180602174957.GX30522@ZenIV.linux.org.uk> <20180603005532.GZ30522@ZenIV.linux.org.uk> <20180604155205.GH30522@ZenIV.linux.org.uk> From: Miklos Szeredi Date: Mon, 4 Jun 2018 21:27:24 +0200 Message-ID: Subject: Re: [PATCH][RFC] open_tree(2) (was Re: [PATCH 30/32] vfs: Allow cloning of a mount tree with open(O_PATH|O_CLONE_MOUNT) [ver #8]) To: Al Viro Cc: David Howells , Christoph Hellwig , linux-fsdevel , linux-afs@lists.infradead.org, LKML , Linux API Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 4, 2018 at 5:52 PM, Al Viro wrote: > On Mon, Jun 04, 2018 at 12:34:44PM +0200, Miklos Szeredi wrote: > >> fsopen = create fsfd >> fsmount = fsfd -> mountfd & set attr on mountfd & attach mountfd >> fspick = path -> fsfd >> move_mount = attach mountfd or move existing >> fsinfo = info from path >> open_tree = new mountfd from path or clone >> mount_setattr = set attr on mountfd >> >> Notice that fsmount() encompasses mount_setattr() + move_mount() >> functionality. Split those out and leave fsmount() to actually do >> the "fsfd ->mountfd" translation? > > Might make sense. > FWIW, to make it clear: fsmount(2) in this series actually does *NOT* > attach it to the tree. Ah, that leaves the mount_setattr() functionality to split out. I'd be more happy to rid this new API of all the old MS_* crap and have have a new set of attributes, that just apply to mounts. It will also need two args: a bitmap of new attributes and a mask to tell us which attributes to change. > Commit message definitely needs updating - as it > is, it's > > +SYSCALL_DEFINE5(fsmount, int, fs_fd, unsigned int, flags, unsigned int, ms_flags, > + void *, reserved4, void *, reserved5) > > PS: IMO these reserved... arguments are in bad taste; if anyone has good reasons > for that practice in ABI design, I'd like to hear those. Agreed. A flags argument is often wise to add even if currently unused (and should be checked for undefined flags), but adding a random number of pointers doesn't seem to make a lot of sense. > >> fsinfo() name suggests it's in the same class as >> fsopen/fsmount/fspick, operating on fsfd object, but's it's not and I >> think that's slightly confusing. >> >> Rename move_mount() -> mount_move()? > > mount_move_bikeshed_bikeshed_bikeshed(), surely? Consistent naming for related functions... not unheard of in API design. The above set definitely does not qualify. >> Also does it make sense to make the cloning behavior of open_tree() >> optional? Without cloning it's just a plain open(O_PATH). That way >> it could be renamed mount_clone(). > > Umm... I'm not sure about that one. If nothing else, OPEN_TREE_DETACH > might be a good idea, in which case cloning is not the primary effect; > hell knows. So conceptually we have the following distinct mount tree operations: treefd = clone(path); treefd = detach(path); attach(treefd, path); move(path1, path2); The detach/move/attach trio are more related in functionality, while clone and detach have the same signature. I'm not sure either. Thanks, Miklos