Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

devpts: comment devpts_mntget()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Christian Brauner and committed by
Greg Kroah-Hartman
4e15f760 a319b01d

+18
+18
fs/devpts/inode.c
··· 152 152 return 0; 153 153 } 154 154 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 + */ 155 173 struct vfsmount *devpts_mntget(struct file *filp, struct pts_fs_info *fsi) 156 174 { 157 175 struct path path;