Re: [PATCH 1/1] driver/tty: Fix a warning in check_tty_count

2014-07-16 Thread Li, ZhenHua
Hi Jiri, You are right, I tested the latest kernel, did not see this bug. So I will only submit this patch to Redhat. Thanks Zhenhua On 07/15/2014 05:16 PM, Jiri Slaby wrote: Hi, On 07/15/2014 11:08 AM, Li, ZhenHua wrote: This bug was founded in RHEL 6, kernel version 2.6.32. But I also che

Re: [PATCH 1/1] driver/tty: Fix a warning in check_tty_count

2014-07-15 Thread Jiri Slaby
Hi, On 07/15/2014 11:08 AM, Li, ZhenHua wrote: > This bug was founded in RHEL 6, kernel version 2.6.32. > > But I also checked the file tty_io.c in latest kernel, not all the code > protected by tty_lock(tty). > > For example, in function tty_del_file, > > if (--tty->count < 0) { > }

Re: [PATCH 1/1] driver/tty: Fix a warning in check_tty_count

2014-07-15 Thread Li, ZhenHua
Hi Peter, This bug was founded in RHEL 6, kernel version 2.6.32. But I also checked the file tty_io.c in latest kernel, not all the code protected by tty_lock(tty). For example, in function tty_del_file, if (--tty->count < 0) { } and tty_del_file(filp); are not surrounded by t

Re: [PATCH 1/1] driver/tty: Fix a warning in check_tty_count

2014-07-14 Thread Peter Hurley
Hi Zhen-Hua, On 07/14/2014 01:54 AM, Li, Zhen-Hua wrote: When there are to many open/close on a tty device in the same time, there may be a warning like: Warning: dev (ttyS0) tty->count(4) != #fd's(3) in tty_release_dev That's because tty->count and files in tty->tty_files are not synchroniz

[PATCH 1/1] driver/tty: Fix a warning in check_tty_count

2014-07-13 Thread Li, Zhen-Hua
When there are to many open/close on a tty device in the same time, there may be a warning like: Warning: dev (ttyS0) tty->count(4) != #fd's(3) in tty_release_dev That's because tty->count and files in tty->tty_files are not synchronized in time. So I add a lock to avoid this. Signed-off-by: Li