Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751191AbdHXBcw (ORCPT ); Wed, 23 Aug 2017 21:32:52 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:35562 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751026AbdHXBcu (ORCPT ); Wed, 23 Aug 2017 21:32:50 -0400 MIME-Version: 1.0 In-Reply-To: <87378hhi3y.fsf@xmission.com> References: <20170816171211.4021-1-christian.brauner@ubuntu.com> <20170816194805.hnof3aqiqykwki7p@gmail.com> <87pobvruzt.fsf@xmission.com> <87ziazqdfr.fsf@xmission.com> <20170824022436.44adb497@mir> <87378hhi3y.fsf@xmission.com> From: Linus Torvalds Date: Wed, 23 Aug 2017 18:32:49 -0700 X-Google-Sender-Auth: XSMzl6bGD2n3w7e7VWwgGekqxc8 Message-ID: Subject: Re: [PATCH 0/1] devpts: use dynamic_dname() to generate proc name To: "Eric W. Biederman" Cc: Stefan Lippers-Hollmann , Christian Brauner , Christian Brauner , Linux Kernel Mailing List , "Serge E. Hallyn" , Al Viro , Thorsten Leemhuis Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1355 Lines: 34 On Wed, Aug 23, 2017 at 6:25 PM, Eric W. Biederman wrote: > > The new behavior is that when we open ptmx we cache a path the slave > pty. Yes. It's not strictly "new", though - we've done that for a while, and if you used /dev/pts/ptmx you'd even have had the *right* path for a while ;) And this exact issue that Stefan is reporting. But nobody ever used /dev/pts/ptmx, so nobody got the right path, and nobody kept an extra reference to the pts mount. > If instead of caching that path we call devpts_acquire to compute the > mount point of the dentry we should be able to skip caching mountpoint > in ptmx_open. Yes, that's my plan - get rid of the 'struct path' entirely, make 'driver_data' point to just the dentry, and then at TIOCGPTPEER time just re-create the path by looking up the vfsmount again (by doingf that "pts" lookup again) It should all be _fairly_ straightforward, but it's definitely a rather bigger change than that "just fix the path" patch was. Anyway, it's already reverted in my tree, I'll push it out after I've verified that there isn't some silly build issue (there won't be, but I've been burned by "this is obviously correct" too many times, so now I always build before pushing anything out unless I'm on my laptop of something when it's just too inconvenient). Linus