Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2152749imm; Sat, 9 Jun 2018 08:52:44 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLku3COztoXRCzKlWjqWBMZOYfuss7dc8V54ee9scoI1Jzu5Xr9GQHhcb8++g6jyjrlNq++ X-Received: by 2002:a62:be0a:: with SMTP id l10-v6mr10499224pff.180.1528559564005; Sat, 09 Jun 2018 08:52:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528559563; cv=none; d=google.com; s=arc-20160816; b=eBxKbZ/WbqFk+A+BQJ5asrmCC6lpFsfY4eBdoDsB0a5cifZBoRYhlo+f7Vv8ys7eva V9ax5r7Ah4IVqQFw6760+Hy132BLRzX0Me2Jdby+liHCOoqNoH0IMhiWWcBT4pl9UBfW Z5tCdOjwsM2gK0inqDqLCNuJSG50GqmUyRJRXNX5lSdNTcEz542py1Cr/jAAs4WsUNp6 Ginft1WKVmlivPTqAz+tYlImPBB9QDoPJGLVQ5nhqFNsNOe6AbuVPjOlrmLX11DdRN2B 2xk+zBkIB3+eDelCYdgLRlysxricMYTK8n+qlu2faQ7R6AK7QsGIKkiNOtbU6++O0VcJ 6e0w== 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:arc-authentication-results; bh=yZL7msJ4XetVfaXi91iAh0vE/To4aVI+SO8We5D6xPE=; b=dx2yELrB4d+gjzm8tCRko5IEjLSPN/xVkG/gAu7PCsU2rC7CIENIHmizuTlSZJs/jp XXnWa3+B/yr8ARfR0Dhz3PbM77m7vwc3FwJLCWyX8O/FBe359hykosEsZvBy+ORb6xtX MWf9A8HNTT9rJKux+Aa5Tz98cF9Trd5tlhIB+jXwqjdZBJiFX/pySI4TqOVJk0d0PEab XtFG3HDMqNT1DOvT7vqQOqUqOnbuQmn0MS4MbEvG+t6mWGpOJq6nD53UGHQuW9NBGjIf 89E3UzLlNOWUV8yofGVOR/Wgwq3rYfGxUkl1fS6A1YKJ1ViFBHWfcKoe//k8B5nv6A8x yjyw== ARC-Authentication-Results: i=1; mx.google.com; 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 r14-v6si35270400pls.479.2018.06.09.08.52.29; Sat, 09 Jun 2018 08:52:43 -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; 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 S932619AbeFIPvL (ORCPT + 99 others); Sat, 9 Jun 2018 11:51:11 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:44640 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751434AbeFIPvJ (ORCPT ); Sat, 9 Jun 2018 11:51:09 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1fRg8y-0000Rr-6O; Sat, 09 Jun 2018 15:51:08 +0000 Date: Sat, 9 Jun 2018 16:51:08 +0100 From: Al Viro To: Linus Torvalds Cc: Linux Kernel Mailing List , linux-fsdevel , Stephane Eranian Subject: Re: [RFC][PATCHES] getting rid of int *open in ->atomic_open() and friends Message-ID: <20180609155107.GH30522@ZenIV.linux.org.uk> References: <20180608184842.GD30522@ZenIV.linux.org.uk> <20180609051051.GF30522@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180609051051.GF30522@ZenIV.linux.org.uk> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 09, 2018 at 06:10:51AM +0100, Al Viro wrote: > That leaves > * anon_inode_getfile() - converts to similar form, at the price of > ihold done slightly earlier, so that failure exit needs a (non-final, i.e. > very cheap) iput() we currently avoid. Not a problem. > * do_shmat() and the second alloc_file() in create_pipe_files(). > Those are rather different - we *do* have an existing dentry/inode/mount > there and all we want on cleanup is path_put() to undo the path_get() > we'd done. > * perfmon mess - _very_ different, and I wouldn't bet a dime on > correctness of failure exits there. One of the issues is that it simulates > mmap as part of setup, so cleanup really is different. > > AFAICS, there's a clear case for alloc_file() wrapper - 6 callers out of > 10 get simpler with it, and the seventh is also a good candidate for the > same treatment. Any naming ideas for that thing ("something" in the above) > would be welcome... > > BTW, that's almost all callers of d_alloc_pseudo() - there is exactly one > caller not of that form (in __ns_get_path()) right now. perfmon should > be another caller, but that might end up converted to the new wrapper... > > As for put_filp()... the callers left in my local tree right now are > * path_openat(), dentry_open(), file_clone_open() (all of the > same form - "put_filp() if it doesn't have FMODE_OPENED, fput() otherwise) > * perfmon mess. > create_pipe_files() got converted to fput() with a bit of massage... Untested followup along those lines pushed; helper called alloc_file_pseudo() and all but 3 callers of alloc_file() got converted to it. perfmon is not touched and it's becoming more and more annoying ;-/ It's also sticking its tender bits into mm/* a lot - what it tries to do, AFAICS, is a heavily open-coded vmalloc-backed mmap() of sorts. It feels like there ought to be a more idiomatic way of doing that kind of stuff... Stephane, could you comment on the situation in there? I realize that you hadn't touched that thing in more than a decade, but I've no idea who else might be familiar with that thing and it's very inconveniently special...