[Devel] [RFC][PATCH 0/6] Enable multiple mounts of devpts

sukadev at us.ibm.com sukadev at us.ibm.com
Mon Aug 4 18:18:44 PDT 2008


I thought I will send out the patches I mentioned to H. Peter Anvin
recently to get some feedback on the general direction. This version
of the patchset ducks the user-space issue, for now.

---

Enable multiple mounts of devpts filesystem so each container can
allocate ptys independently.

To enable multiple mounts (most) devpts interfaces need to know which
instance of devpts is being accessed. This patchset uses the 'struct
inode' of the device being accessed to identify the appropriate devpts
instance. It then uses get_sb_nodev() instead of get_sb_single() to
allow multiple mounts

	PATCH 1/6	Pass-in 'struct inode' to devpts interfaces
	PATCH 2/6	Remove 'devpts_root' global
	PATCH 3/6	Move 'allocated_ptys' to sb->s_s_fs_info
	PATCH 4/6	Allow mknod of ptmx and tty devices
	PATCH 5/6	Allow multiple mounts of devpts
	PATCH 6/6	Tweak in init_dev() /dev/tty

If devpts is mounted just once, this patchset should not change any behavior.

If devpts is mounted more than once, then '/dev/ptmx' must be a symlink
to '/dev/pts/ptmx' and in each new devpts mount we must create the
device node '/dev/pts/ptmx' [c, 5;2] by hand.

Have only done some basic testing with multiple mounts and sshd. May not
be bisect-safe.

Appreciate comments on overall approach of my mapping from the inode
to sb->s_fs_info to allocated_ptys and the hacky use of get_sb_nodev(),
and also on the tweak to init_dev() (patch 6).

Todo:
	User-space impact of /dev/ptmx symlink - Options are being
	discussed on mailing list (new mount option and config token,
	new fs name, etc)

	Remove even initial kernel mount of devpts ?
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list