Re: fasync race in fs/fcntl.c

2013-03-03 Thread Greg KH
On Sun, Mar 03, 2013 at 10:16:10PM -0800, Russ Dill wrote: > On Sat, Mar 2, 2013 at 4:09 PM, Russ Dill wrote: > > On Sat, Mar 2, 2013 at 11:49 AM, Al Viro wrote: > >> On Sat, Mar 02, 2013 at 03:00:28AM -0800, Russ Dill wrote: > >>> I'm seeing a race in fs/fcntl.c. I'm not sure exactly how the rac

Re: fasync race in fs/fcntl.c

2013-03-03 Thread Russ Dill
On Sat, Mar 2, 2013 at 4:09 PM, Russ Dill wrote: > On Sat, Mar 2, 2013 at 11:49 AM, Al Viro wrote: >> On Sat, Mar 02, 2013 at 03:00:28AM -0800, Russ Dill wrote: >>> I'm seeing a race in fs/fcntl.c. I'm not sure exactly how the race is >>> occurring, but the following is my best guess. A kernel lo

Re: fasync race in fs/fcntl.c

2013-03-02 Thread Russ Dill
On Sat, Mar 2, 2013 at 11:49 AM, Al Viro wrote: > On Sat, Mar 02, 2013 at 03:00:28AM -0800, Russ Dill wrote: >> I'm seeing a race in fs/fcntl.c. I'm not sure exactly how the race is >> occurring, but the following is my best guess. A kernel log is >> attached. > > [snip the analysis - it's a diffe

Re: fasync race in fs/fcntl.c

2013-03-02 Thread Al Viro
On Sat, Mar 02, 2013 at 03:00:28AM -0800, Russ Dill wrote: > I'm seeing a race in fs/fcntl.c. I'm not sure exactly how the race is > occurring, but the following is my best guess. A kernel log is > attached. [snip the analysis - it's a different lock anyway] The traces below are essentially sys_e

Re: fasync race in fs/fcntl.c

2013-03-02 Thread Al Viro
On Sat, Mar 02, 2013 at 06:42:43PM +, Al Viro wrote: > ... what makes you think that it's fown->lock, in the first place? > > > [172635.399651] <> [] _raw_read_lock+0x13/0x20 > > [172635.399654] [] send_sigio+0x52/0xf0 > > send_sigio() is > [initialization of a local variable to 1] >

Re: fasync race in fs/fcntl.c

2013-03-02 Thread Al Viro
On Sat, Mar 02, 2013 at 03:00:28AM -0800, Russ Dill wrote: > I'm seeing a race in fs/fcntl.c. I'm not sure exactly how the race is > occurring, but the following is my best guess. A kernel log is > attached. > > The comment for fasync_insert_entry: > > * NOTE! It is very important that the FASYN

Re: fasync race in fs/fcntl.c

2013-03-02 Thread Al Viro
On Sat, Mar 02, 2013 at 03:00:28AM -0800, Russ Dill wrote: > CPU0 calls syscall fcntl(fd, F_SETFL, FASYNC) > fcntl calls fdget_raw, the count on the filp is 1, so it is not > incremented (no reference taken) > fcntl calls do_fcntl, which calls setfl which calls filp->op->fasync > which calls fasyn