From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zeniv.linux.org.uk ([195.92.253.2]:34646 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726812AbeGLMww (ORCPT ); Thu, 12 Jul 2018 08:52:52 -0400 Date: Thu, 12 Jul 2018 13:43:26 +0100 From: Al Viro To: Linus Torvalds Cc: linux-fsdevel , Linux Kernel Mailing List , Miklos Szeredi Subject: Re: [RFC][PATCH 01/42] drm_mode_create_lease_ioctl(): fix open-coded filp_clone_open() Message-ID: <20180712124326.GA19272@ZenIV.linux.org.uk> References: <20180711021136.GN30522@ZenIV.linux.org.uk> <20180711022206.12571-1-viro@ZenIV.linux.org.uk> <20180711152555.GR30522@ZenIV.linux.org.uk> <20180711161540.GS30522@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180711161540.GS30522@ZenIV.linux.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Jul 11, 2018 at 05:15:40PM +0100, Al Viro wrote: > Actually, looking at the entire thing, I'm rather tempted to go for > alloc_empty_file(f_flags, cred) > setting both f_flags and f_flags-derived part of f_mode, making > alloc_file_pseudo(inode, mnt, name, f_flags, ops) > alloc_file_clone(base, f_flags, ops) > do the same automatically as they call alloc_empty_file(). See vfs.git#work.open3; one commit added just before "pass creds to get_empty_filp(), make sure dentry_open() passes the right creds", one just after. The first one ("alloc_file(): switch to passing O_... flags instead of FMODE_... mode") pulls ->f_flags assignments into preceding alloc_file(), the second ("pass ->f_flags value to alloc_empty_file()") makes alloc_empty_file() set ->f_flags and ->f_flags-derived part of ->f_mode, with do_dentry_open() leaving these parts of ->f_mode alone. The rest is pretty much identical to the previous iteration of the series, except that alloc_file wrappers inherit the switch to passing O_... A question regarding the customs in such situations - are previous Reviewed-by/Acked-by normally kept across rebases like that?