Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated devpts via path lookup
From: Linus Torvalds
Date: Mon Apr 11 2016 - 21:18:38 EST
On Mon, Apr 11, 2016 at 6:06 PM, H. Peter Anvin <hpa@xxxxxxxxx> wrote:
>
> Why bother with an automount? You can look up ../ptmx from the devpts get_super method and just do the bind mount once. No fuss, no muss. What's wrong with that?
Ehh. What if somebody wants to mount the same devpts in multiple
places? So now you need to do the bind mount every time devpts is
bindmounted?
None of this makes sense.
Let's just take Eric's patch, and strip out the permission check, and
strip out the code that fakes a new path for it.
That gets rid of 90% of devpts_path_ptmx(): all that remains is pretty
much the "are we already in devpts" and the call to "path_pts()"
thing.
No update_file_path(), no inode_permissions, no fsi->ptmx_dentry
games. Just get a reference to the "pts_fs_info", and it's all done.
(Getting a ref on the pts_fs_info might require us to have a ref to
the superblock, I didn't check that part. But rather than updating the
file path, just save it off in the file data).
Linus