Re: Enhance ptyfs to handle multiple instances.

2014-04-04 Thread Ilya Zykov
- I don't like the refactoring because it makes ptyfs less optional (brings in code and headers to the base kernel). I think it is simpler to provide an entry function to get the mount point instead, and this way all the guts of ptyfs stay in ptyfs. Looks better, thank you. - Is it

Re: Enhance ptyfs to handle multiple instances.

2014-04-04 Thread Ilya Zykov
Some misspelling corrections. fs/ptyfs/ptyfs.h|2 + fs/ptyfs/ptyfs_vfsops.c | 63 ++-- fs/ptyfs/ptyfs_vnops.c | 25 ++- kern/tty_bsdpty.c | 11 +++- kern/tty_ptm.c | 45

Re: Enhance ptyfs to handle multiple instances.

2014-04-04 Thread Christos Zoulas
On Apr 4, 12:29pm, net...@izyk.ru (Ilya Zykov) wrote: -- Subject: Re: Enhance ptyfs to handle multiple instances. | | - I don't like the refactoring because it makes ptyfs less optional (brings |in code and headers to the base kernel). I think it is simpler to provide |an entry

Re: Enhance ptyfs to handle multiple instances.

2014-04-04 Thread Ilya Zykov
Should we put a pointer in the pty node that points to the primary mount point then so we get the correct one? Why? In general case we forever must return first which mount first, next mount point, shouldn't replace previous, else incorrect TIOCPTMGET(path) for already opened pty we will

Re: Enhance ptyfs to handle multiple instances.

2014-04-04 Thread Ilya Zykov
On 04.04.2014 18:40, Ilya Zykov wrote: Should we put a pointer in the pty node that points to the primary mount point then so we get the correct one? Why? In general case we forever must return first which mount first, next mount point, shouldn't replace previous, else incorrect

Re: Enhance ptyfs to handle multiple instances.

2014-04-04 Thread Christos Zoulas
On Apr 4, 6:40pm, net...@izyk.ru (Ilya Zykov) wrote: -- Subject: Re: Enhance ptyfs to handle multiple instances. | | Should we put a pointer in the pty node that points to the primary mount point | then so we get the correct one? | | Why? In general case we forever must return first which

Re: Enhance ptyfs to handle multiple instances.

2014-04-04 Thread Ilya Zykov
On 04.04.2014 18:55, Christos Zoulas wrote: On Apr 4, 6:40pm, net...@izyk.ru (Ilya Zykov) wrote: -- Subject: Re: Enhance ptyfs to handle multiple instances. | | Should we put a pointer in the pty node that points to the primary mount point | then so we get the correct one

Re: Enhance ptyfs to handle multiple instances.

2014-04-04 Thread Ilya Zykov
On 04.04.2014 18:55, Christos Zoulas wrote: On Apr 4, 6:40pm, net...@izyk.ru (Ilya Zykov) wrote: -- Subject: Re: Enhance ptyfs to handle multiple instances. | | Should we put a pointer in the pty node that points to the primary mount point | then so we get the correct one

Re: Enhance ptyfs to handle multiple instances.

2014-04-04 Thread Ilya Zykov
On 04.04.2014 18:55, Christos Zoulas wrote: On Apr 4, 6:40pm, net...@izyk.ru (Ilya Zykov) wrote: -- Subject: Re: Enhance ptyfs to handle multiple instances. | | Should we put a pointer in the pty node that points to the primary mount point | then so we get the correct one

Re: Enhance ptyfs to handle multiple instances.

2014-04-04 Thread Christos Zoulas
On Apr 4, 7:28pm, net...@izyk.ru (Ilya Zykov) wrote: -- Subject: Re: Enhance ptyfs to handle multiple instances. | On 04.04.2014 18:55, Christos Zoulas wrote: | On Apr 4, 6:40pm, net...@izyk.ru (Ilya Zykov) wrote: | -- Subject: Re: Enhance ptyfs to handle multiple instances

Re: Enhance ptyfs to handle multiple instances.

2014-04-04 Thread Ilya Zykov
Small test. #include util.h #include stdio.h #include termios.h #include err.h #include stdlib.h #include sys/types.h #include sys/ioctl.h #include sys/stat.h #include errno.h #include fcntl.h #include grp.h #include stdio.h #include string.h #include unistd.h main (){ int amaster,

Re: Enhance ptyfs to handle multiple instances.

2014-04-03 Thread Christos Zoulas
On Apr 2, 10:36am, net...@izyk.ru (Ilya Zykov) wrote: -- Subject: Re: Enhance ptyfs to handle multiple instances. Looks very good. Some changes: - I don't like the refactoring because it makes ptyfs less optional (brings in code and headers to the base kernel). I think it is simpler to provide

Re: Enhance ptyfs to handle multiple instances.

2014-04-02 Thread Ilya Zykov
On 01.04.2014 23:38, Ilya Zykov wrote: Hello! This patch introduces subject. Some code refactoring, because we have more stronger ptm - ptyfs binding. BSD pty compatibility improvement. Main explanation you can see in comments inside. Also I am not sure about, how, correctly release

Re: Enhance ptyfs to handle multiple instances.

2014-04-01 Thread Ilya Zykov
Hello! This patch introduces subject. Some code refactoring, because we have more stronger ptm - ptyfs binding. BSD pty compatibility improvement. Main explanation you can see in comments inside. Also I am not sure about, how, correctly release unused vnode and return it for system and call

Re: Enhance ptyfs to handle multiple instances.

2014-03-27 Thread Ilya Zykov
Hello! Maybe you skipped: Minor corrections readdir and lookup for multi-mountpoint use. ptyfs_vnops.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) Resending. Also main patch for subject. I didn't want locate many code in ptm driver, but in real world, it was the most

Re: Enhance ptyfs to handle multiple instances.

2014-03-27 Thread Ilya Zykov
On 27.03.2014 12:51, Ilya Zykov wrote: Hello! Maybe you skipped: Minor corrections readdir and lookup for multi-mountpoint use. ptyfs_vnops.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) Resending. Also main patch for subject. I didn't want locate many code in ptm

Re: Enhance ptyfs to handle multiple instances.

2014-03-27 Thread Christos Zoulas
On Mar 27, 5:53pm, net...@izyk.ru (Ilya Zykov) wrote: -- Subject: Re: Enhance ptyfs to handle multiple instances. | This is a multi-part message in MIME format. | --040300020609040305030709 | Content-Type: text/plain; charset=ISO-8859-1 | Content-Transfer-Encoding: 7bit

Re: Enhance ptyfs to handle multiple instances.

2014-03-27 Thread Ilya Zykov
| On 27.03.2014 12:51, Ilya Zykov wrote: | Hello! | Maybe you skipped: | Minor corrections readdir and lookup for multi-mountpoint use. | | ptyfs_vnops.c |6 -- | 1 file changed, 4 insertions(+), 2 deletions(-) Please, don't forget this, otherwise readdir returns

Re: Enhance ptyfs to handle multiple instances.

2014-03-27 Thread Christos Zoulas
On Mar 28, 12:37am, net...@izyk.ru (Ilya Zykov) wrote: -- Subject: Re: Enhance ptyfs to handle multiple instances. | Please, don't forget this, otherwise readdir returns released(free), but still hashed inode numbers. | Got it, thanks! christos

Re: Enhance ptyfs to handle multiple instances.

2014-03-26 Thread Ilya Zykov
Hello! Minor corrections readdir and lookup for multi-mountpoint use. ptyfs_vnops.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) Ilya. Index: fs/ptyfs/ptyfs_vnops.c === RCS file:

Re: Enhance ptyfs to handle multiple instances.

2014-03-26 Thread Christos Zoulas
On Mar 26, 2:09pm, net...@izyk.ru (Ilya Zykov) wrote: -- Subject: Re: Enhance ptyfs to handle multiple instances. | Index: fs/ptyfs/ptyfs_subr.c | === | RCS file: /cvsil/nbcur/src/sys/fs/ptyfs/ptyfs_subr.c,v | retrieving revision

Re: Enhance ptyfs to handle multiple instances.

2014-03-26 Thread Ilya Zykov
PTYFS has dependency from ptm driver. If config has NO_DEV_PTM, PTYFS isn't compiled. PTYFS is useless without ptm. How, better, this condition is fixed in config files?

Re: Enhance ptyfs to handle multiple instances.

2014-03-26 Thread Christos Zoulas
On Mar 26, 6:36pm, net...@izyk.ru (Ilya Zykov) wrote: -- Subject: Re: Enhance ptyfs to handle multiple instances. | PTYFS has dependency from ptm driver. | If config has NO_DEV_PTM, PTYFS isn't compiled. | PTYFS is useless without ptm. | | How, better, this condition is fixed in config files

Re: Enhance ptyfs to handle multiple instances.

2014-03-26 Thread Christos Zoulas
In article 5332dc47.1060...@izyk.ru, Ilya Zykov net...@izyk.ru wrote: | | - error = (*ptm-makename)(ptm, l, name, sizeof(name), dev, ms); | + error = pty_makename(ptm, l, name, sizeof(name), dev, ms); |if (error) |return error; | Are you sure about this one? It is

Re: Enhance ptyfs to handle multiple instances.

2014-03-25 Thread David Laight
On Mon, Mar 24, 2014 at 10:49:15AM -0400, Christos Zoulas wrote: On Mar 24, 5:46pm, net...@izyk.ru (Ilya Zykov) wrote: -- Subject: Re: Enhance ptyfs to handle multiple instances. | Hello! | | Please, tell me know if I wrong. | In general case I can't find(easy), from driver, where its

Re: Enhance ptyfs to handle multiple instances.

2014-03-24 Thread Ilya Zykov
Hello! Please, tell me know if I wrong. In general case I can't find(easy), from driver, where its device file located on file system, its vnode or its directory vnode where this file located. Such files can be many and I can't find what file used for current operation. Maybe anybody had being

Re: Enhance ptyfs to handle multiple instances.

2014-03-24 Thread Christos Zoulas
On Mar 24, 5:46pm, net...@izyk.ru (Ilya Zykov) wrote: -- Subject: Re: Enhance ptyfs to handle multiple instances. | Hello! | | Please, tell me know if I wrong. | In general case I can't find(easy), from driver, where its device file located on file system, | its vnode or its directory vnode

Re: Enhance ptyfs to handle multiple instances.

2014-03-24 Thread Ilya Zykov
You can't find from the driver where the device node file is located OK, I thought so. Thank you.

Re: Enhance ptyfs to handle multiple instances.

2014-03-22 Thread Ilya Zykov
I don't understand why you want to get rid of the mountpoint arg inside the pty structure. It certainly makes things faster, and the pty can't be shared... christos Sorry, but I don't understand too, what structure do you mean exactly and how. Ilya.

Re: Enhance ptyfs to handle multiple instances.

2014-03-22 Thread Christos Zoulas
On Mar 22, 3:50pm, net...@izyk.ru (Ilya Zykov) wrote: -- Subject: Re: Enhance ptyfs to handle multiple instances. | | I don't understand why you want to get rid of the mountpoint arg inside | the pty structure. It certainly makes things faster, and the pty can't | be shared

Re: Enhance ptyfs to handle multiple instances.

2014-03-22 Thread Christos Zoulas
In article 532def5e.2040...@izyk.ru, Ilya Zykov net...@izyk.ru wrote: The mountpoint inside ptm_pty. Perhaps by having separate instances in the ptm driver? christos I think, it's not better. I can do so, but: 1. Now we have only 2 instances ptm_pty, one for ptyfs one for bsdpty and

Re: Enhance ptyfs to handle multiple instances.

2014-03-21 Thread Ilya Zykov
Hello! Correct ptyfs_readdir for multi mount points use. ptyfs.h |1 + ptyfs_subr.c |3 +-- ptyfs_vnops.c |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) Ilya. Index: fs/ptyfs/ptyfs.h === RCS file:

Re: Enhance ptyfs to handle multiple instances.

2014-03-21 Thread Christos Zoulas
In article 532c0718.3020...@izyk.ru, Ilya Zykov net...@izyk.ru wrote: -=-=-=-=-=- Hello! Correct ptyfs_readdir for multi mount points use. committed. christos

Re: Enhance ptyfs to handle multiple instances.

2014-03-21 Thread Ilya Zykov
DONE. :) If seriously, it's first working prototype for comments and objections. It's working as follow: Mount first ptyfs instance in /dev/pts(or other path) you can get access to master side through ptm{x} device. Mount second ptyfs instance inside chroot(Example: /var/chroot/test/dev/pts),

Re: Enhance ptyfs to handle multiple instances.

2014-03-21 Thread Christos Zoulas
On Mar 21, 10:23pm, net...@izyk.ru (Ilya Zykov) wrote: -- Subject: Re: Enhance ptyfs to handle multiple instances. | If seriously, it's first working prototype for comments and objections. | | It's working as follow: | | Mount first ptyfs instance in /dev/pts(or other path) you can get access

Re: Enhance ptyfs to handle multiple instances.

2014-03-19 Thread Ilya Zykov
Hello! For not accumulate many changes and keep patch clear. I am sending some error fix and modifications for future work and discussion too. Please, if possible, include it in current tree. Little explanations: 1. We shouldn't mount more than one ptyfs.(dependency from unmount order).

Re: Enhance ptyfs to handle multiple instances.

2014-03-19 Thread Ilya Zykov
| *--bp = '\0'; | - error = getcwd_common(cwdi-cwdi_rdir, rootvnode, bp, | + error = getcwd_common(mp-mnt_vnodecovered, cwdi-cwdi_rdir, bp, | buf, MAXBUF / 2, 0, l); Might as well pass NULL for cwdi-cwdi_rdir, since it does the same. But it is less obvious, and haven't

Re: Enhance ptyfs to handle multiple instances.

2014-03-19 Thread Christos Zoulas
On Mar 19, 9:51pm, net...@izyk.ru (Ilya Zykov) wrote: -- Subject: Re: Enhance ptyfs to handle multiple instances. | Ok, but bug will stay in the system, temporarily. No problem, no worse than we have now. christos | | fs/ptyfs/ptyfs_vfsops.c | 16 +++- | kern/tty_ptm.c

Re: Enhance ptyfs to handle multiple instances.

2014-03-19 Thread Ilya Zykov
| People did not like that. | | Didn't like what if 1 or return EBUSY? The return EBUSY... Ok, but bug will stay in the system, temporarily. fs/ptyfs/ptyfs_vfsops.c | 16 +++- kern/tty_ptm.c |9 - 2 files changed, 19 insertions(+), 6 deletions(-) Ilya.

Re: Enhance ptyfs to handle multiple instances.

2014-03-19 Thread Paul_Koning
On Mar 19, 2014, at 1:17 PM, Ilya Zykov net...@izyk.ru wrote: |*--bp = '\0'; | - error = getcwd_common(cwdi-cwdi_rdir, rootvnode, bp, | + error = getcwd_common(mp-mnt_vnodecovered, cwdi-cwdi_rdir, bp, |buf, MAXBUF / 2, 0, l); Might as well pass NULL for cwdi-cwdi_rdir, since

Enhance ptyfs to handle multiple instances.

2014-03-14 Thread Ilya Zykov
Hello! I desire develop this project. About me. I am system administrator in little Italy-Russia's firm. I live in Moscow. OS kernel it's my hobby mainly. I have free time now and can do this project about 1-2 months. I have little experience with Linux kernel's tty layer and few accepted

Re: Enhance ptyfs to handle multiple instances.

2014-03-14 Thread Christos Zoulas
On Mar 14, 12:30pm, net...@izyk.ru (Ilya Zykov) wrote: -- Subject: Enhance ptyfs to handle multiple instances. | Hello! | I desire develop this project. Excellent. | About me. | I am system administrator in little Italy-Russia's firm. I live in Moscow. | OS kernel it's my hobby mainly. | I have

Re: Enhance ptyfs to handle multiple instances.

2014-03-14 Thread Ilya Zykov
| I have few questions about project. | Christos, can I ask you about this? | Please, if anybody has objections or already doing it, tell me know. Nobody is already doing it, and if you have questions, you came to the right place. christos Ok. 1. The main problem and question in

Re: Enhance ptyfs to handle multiple instances.

2014-03-14 Thread Justin Cormack
On Fri, Mar 14, 2014 at 1:29 PM, Ilya Zykov net...@izyk.ru wrote: | I have few questions about project. | Christos, can I ask you about this? | Please, if anybody has objections or already doing it, tell me know. Nobody is already doing it, and if you have questions, you came to the right

Re: Enhance ptyfs to handle multiple instances.

2014-03-14 Thread Joerg Sonnenberger
On Fri, Mar 14, 2014 at 09:51:12AM -0400, Christos Zoulas wrote: I don't think that putting ptmx inside devpts makes sense. OTOH, we could have multiple ptmx devices with different minor numbers and use that as the differentiating factor for the pty devices. I think that's too complex and

Re: Enhance ptyfs to handle multiple instances.

2014-03-14 Thread Christos Zoulas
In article 20140314143532.ga17...@britannica.bec.de, Joerg Sonnenberger jo...@britannica.bec.de wrote: On Fri, Mar 14, 2014 at 09:51:12AM -0400, Christos Zoulas wrote: I don't think that putting ptmx inside devpts makes sense. OTOH, we could have multiple ptmx devices with different minor

Re: Enhance ptyfs to handle multiple instances.

2014-03-14 Thread Ilya Zykov
On 14.03.2014 17:51, Christos Zoulas wrote: On Mar 14, 5:29pm, net...@izyk.ru (Ilya Zykov) wrote: -- Subject: Re: Enhance ptyfs to handle multiple instances. | Ok. | | 1. The main problem and question in this project(IMHO), it's how get access for every instance through one driver ptm[x

Re: Enhance ptyfs to handle multiple instances.

2014-03-14 Thread Christos Zoulas
On Mar 14, 6:49pm, net...@izyk.ru (Ilya Zykov) wrote: -- Subject: Re: Enhance ptyfs to handle multiple instances. | We first need to decide if disclosing gaps in the pty number is a security | issue. If not, it is simple; we just allocate the next free one and we don't | care about gaps. I.e

Re: Enhance ptyfs to handle multiple instances.

2014-03-14 Thread Ilya Zykov
On 14.03.2014 18:40, Christos Zoulas wrote: In article 20140314143532.ga17...@britannica.bec.de, Joerg Sonnenberger jo...@britannica.bec.de wrote: On Fri, Mar 14, 2014 at 09:51:12AM -0400, Christos Zoulas wrote: I don't think that putting ptmx inside devpts makes sense. OTOH, we could have

Re: Enhance ptyfs to handle multiple instances.

2014-03-14 Thread Ilya Zykov
if the first mount can only have [0..n-1] the second [n...2*n] etc... 165:0 165:1 is ptm[x] first instance devices. 165:2 165:3 is ptm[x] second instance devices ... Every instance can have [0..N] pts devices. Ilya.

Re: Enhance ptyfs to handle multiple instances.

2014-03-14 Thread Brian Buhrow
Hello. I actually do use ptmx(4) without ptyfs, but I would be willing for that to go away in NetBSD-7 or 8. -Brian On Mar 14, 2:40pm, Christos Zoulas wrote: } Subject: Re: Enhance ptyfs to handle multiple instances. } In article 20140314143532.ga17...@britannica.bec.de, } Joerg

Re: Enhance ptyfs to handle multiple instances.

2014-03-14 Thread Taylor R Campbell
Date: Fri, 14 Mar 2014 14:40:50 + (UTC) From: chris...@astron.com (Christos Zoulas) In article 20140314143532.ga17...@britannica.bec.de, Joerg Sonnenberger jo...@britannica.bec.de wrote: Actually, it would simplify things a lot if /dev/ptmx was a symlink to /dev/pts/ptmx.

Re: Enhance ptyfs to handle multiple instances.

2014-03-14 Thread Christos Zoulas
On Mar 14, 5:08pm, campbell+netbsd-tech-k...@mumble.net (Taylor R Campbell) wrote: -- Subject: Re: Enhance ptyfs to handle multiple instances. | We could install a symlink at /dev/ptmx pointing to pts/ptmx, and we | could install a device node at /dev/pts/ptmx, which gets hidden by the | ptyfs