Skip to content

Commit 4e15f76

Browse files
Christian Braunergregkh
authored andcommitted
devpts: comment devpts_mntget()
Signed-off-by: Christian Brauner <[email protected]> Acked-by: "Eric W. Biederman" <[email protected]> Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a319b01 commit 4e15f76

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

fs/devpts/inode.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,24 @@ static int devpts_ptmx_path(struct path *path)
152152
return 0;
153153
}
154154

155+
/*
156+
* Try to find a suitable devpts filesystem. We support the following
157+
* scenarios:
158+
* - The ptmx device node is located in the same directory as the devpts
159+
* mount where the pts device nodes are located.
160+
* This is e.g. the case when calling open on the /dev/pts/ptmx device
161+
* node when the devpts filesystem is mounted at /dev/pts.
162+
* - The ptmx device node is located outside the devpts filesystem mount
163+
* where the pts device nodes are located. For example, the ptmx device
164+
* is a symlink, separate device node, or bind-mount.
165+
* A supported scenario is bind-mounting /dev/pts/ptmx to /dev/ptmx and
166+
* then calling open on /dev/ptmx. In this case a suitable pts
167+
* subdirectory can be found in the common parent directory /dev of the
168+
* devpts mount and the ptmx bind-mount, after resolving the /dev/ptmx
169+
* bind-mount.
170+
* If no suitable pts subdirectory can be found this function will fail.
171+
* This is e.g. the case when bind-mounting /dev/pts/ptmx to /ptmx.
172+
*/
155173
struct vfsmount *devpts_mntget(struct file *filp, struct pts_fs_info *fsi)
156174
{
157175
struct path path;

0 commit comments

Comments
 (0)