Re: question on tty open and close

2007-03-28 Thread Marcel Holtmann
Hi Alan, > > As long as the new behavior continues to call > > driver->close() if driver->open() succeeds > > then I see no problem. > > It breaks if any existing driver is doing no cleanup in ->open() when it > fails but relying upon ->close() being called. That is what needs > auditing first

Re: question on tty open and close

2007-03-28 Thread Kilau, Scott
> > > > > So we have a file that's closed although open() never succeeded? > > > > > > > > That's correct! It's been a pain in my butt for years. > > > > > > How did you deal with that proctological issue? > > > > Just make sure the close() handles the situation properly. It makes > > reference

Re: question on tty open and close

2007-03-28 Thread Paul Fulghum
Alan Cox wrote: It breaks if any existing driver is doing no cleanup in ->open() when it fails but relying upon ->close() being called. That is what needs auditing first of all. Yes, I did not think of that. -- Paul Fulghum Microgate Systems, Ltd. - To unsubscribe from this list: send the

Re: question on tty open and close

2007-03-28 Thread Alan Cox
> As long as the new behavior continues to call > driver->close() if driver->open() succeeds > then I see no problem. It breaks if any existing driver is doing no cleanup in ->open() when it fails but relying upon ->close() being called. That is what needs auditing first of all. - To unsubscribe

Re: question on tty open and close

2007-03-28 Thread Paul Fulghum
Alan Cox wrote: I'm also not aware of any reason other than history, which means if someone cares to double check the other drivers there really shouldn't be an obstacle to "fixing" this behaviour. Unless anyone knows different ? As long as the new behavior continues to call driver->close()

Re: question on tty open and close

2007-03-28 Thread Alan Cox
> > > > So we have a file that's closed although open() never succeeded? > > > > > > That's correct! It's been a pain in my butt for years. > > > > How did you deal with that proctological issue? > > Just make sure the close() handles the situation properly. It makes > reference counting...

RE: question on tty open and close

2007-03-28 Thread Stuart MacDonald
From: Oliver Neukum [mailto:[EMAIL PROTECTED] > Am Mittwoch, 28. März 2007 15:10 schrieb Stuart MacDonald: > > > We find that a failure in open() leads to release_dev() > being called. > > > release_dev() calls close(): > > > > > >   if (tty->driver->close) > > >   

Re: question on tty open and close

2007-03-28 Thread Oliver Neukum
Am Mittwoch, 28. März 2007 15:10 schrieb Stuart MacDonald: > > We find that a failure in open() leads to release_dev() being called. > > release_dev() calls close(): > > > >   if (tty->driver->close) > >   tty->driver->close(tty, filp); > > > > So we have a file that's closed

RE: question on tty open and close

2007-03-28 Thread Stuart MacDonald
From: [EMAIL PROTECTED] > in tty_io.c::tty_open(): [snip] > We find that a failure in open() leads to release_dev() being called. > release_dev() calls close(): > > if (tty->driver->close) > tty->driver->close(tty, filp); > > So we have a file that's closed although open()

RE: question on tty open and close

2007-03-28 Thread Stuart MacDonald
From: [EMAIL PROTECTED] in tty_io.c::tty_open(): [snip] We find that a failure in open() leads to release_dev() being called. release_dev() calls close(): if (tty-driver-close) tty-driver-close(tty, filp); So we have a file that's closed although open() never

Re: question on tty open and close

2007-03-28 Thread Oliver Neukum
Am Mittwoch, 28. März 2007 15:10 schrieb Stuart MacDonald: We find that a failure in open() leads to release_dev() being called. release_dev() calls close():   if (tty-driver-close)   tty-driver-close(tty, filp); So we have a file that's closed although open() never

RE: question on tty open and close

2007-03-28 Thread Stuart MacDonald
From: Oliver Neukum [mailto:[EMAIL PROTECTED] Am Mittwoch, 28. März 2007 15:10 schrieb Stuart MacDonald: We find that a failure in open() leads to release_dev() being called. release_dev() calls close():   if (tty-driver-close)   tty-driver-close(tty, filp);

Re: question on tty open and close

2007-03-28 Thread Alan Cox
So we have a file that's closed although open() never succeeded? That's correct! It's been a pain in my butt for years. How did you deal with that proctological issue? Just make sure the close() handles the situation properly. It makes reference counting... fun. The serial

Re: question on tty open and close

2007-03-28 Thread Paul Fulghum
Alan Cox wrote: I'm also not aware of any reason other than history, which means if someone cares to double check the other drivers there really shouldn't be an obstacle to fixing this behaviour. Unless anyone knows different ? As long as the new behavior continues to call driver-close() if

Re: question on tty open and close

2007-03-28 Thread Alan Cox
As long as the new behavior continues to call driver-close() if driver-open() succeeds then I see no problem. It breaks if any existing driver is doing no cleanup in -open() when it fails but relying upon -close() being called. That is what needs auditing first of all. - To unsubscribe from

Re: question on tty open and close

2007-03-28 Thread Paul Fulghum
Alan Cox wrote: It breaks if any existing driver is doing no cleanup in -open() when it fails but relying upon -close() being called. That is what needs auditing first of all. Yes, I did not think of that. -- Paul Fulghum Microgate Systems, Ltd. - To unsubscribe from this list: send the line

Re: question on tty open and close

2007-03-28 Thread Kilau, Scott
So we have a file that's closed although open() never succeeded? That's correct! It's been a pain in my butt for years. How did you deal with that proctological issue? Just make sure the close() handles the situation properly. It makes reference counting... fun.

Re: question on tty open and close

2007-03-28 Thread Marcel Holtmann
Hi Alan, As long as the new behavior continues to call driver-close() if driver-open() succeeds then I see no problem. It breaks if any existing driver is doing no cleanup in -open() when it fails but relying upon -close() being called. That is what needs auditing first of all. I know