Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751133AbdHXCBM (ORCPT ); Wed, 23 Aug 2017 22:01:12 -0400 Received: from mail-oi0-f53.google.com ([209.85.218.53]:34203 "EHLO mail-oi0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750715AbdHXCBL (ORCPT ); Wed, 23 Aug 2017 22:01:11 -0400 MIME-Version: 1.0 In-Reply-To: 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 19:01:10 -0700 X-Google-Sender-Auth: HpFe13vRKZCGSluJyNcaZKWmvOQ 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: 1069 Lines: 29 On Wed, Aug 23, 2017 at 6:49 PM, Linus Torvalds wrote: > > Argh. And it's *not* fairly straightforward, because the > tty_operations "ioctl()" function pointer only gets 'struct tty *'. > > So in the TIOCGPTPEER path, we don't actually have access to the file > pointer of the fd we're doing the ioctl on. > > And that's where the 'struct path' to the 'ptmx' node is - which we > need to then look up the 'pts' directory. > > How very annoying. I think that's why we did it all at ptmx_open() > time, because then we had all the information. Anyway, the revert is pushed out. So we're back to the old behavior that gives the wrong pathname in /proc. And I think I can handle the lack of a 'struct file *' to the ioctl operations by just special-casing TIOCGPTPEER directly in tty_ioctl() itself. That's where we handle "generic" tty ioctls, and doing pty stuff there is kind of wrong, but pty's are special. But I think I'll leave it for tomorrow. So Eric, if you feel like looking at this, I'd appreciate it. Linus