Re: Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-09 Thread Andrew W Elble
> But...suppose we have two racing OPEN calls. They're both in > nfs4_get_vfs_file. One opens the file and succeeds and the other fails > and ends up in out_put_access. At that point, you could end up > clobbering the successful update to st_access_bmap from the other task, > and we'd end up not

Re: Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-09 Thread Andrew W Elble
> But...suppose we have two racing OPEN calls. They're both in > nfs4_get_vfs_file. One opens the file and succeeds and the other fails > and ends up in out_put_access. At that point, you could end up > clobbering the successful update to st_access_bmap from the other task, > and we'd end up not

Re: Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-08 Thread Oleg Drokin
On Jun 8, 2016, at 1:22 PM, Jeff Layton wrote: > On Wed, 2016-06-08 at 12:10 -0400, Oleg Drokin wrote: >> On Jun 8, 2016, at 6:58 AM, Jeff Layton wrote: >> >>> A simple way to confirm that might be to convert all of the read locks >>> on the st_rwsem to write locks. That will serialize all of

Re: Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-08 Thread Oleg Drokin
On Jun 8, 2016, at 1:22 PM, Jeff Layton wrote: > On Wed, 2016-06-08 at 12:10 -0400, Oleg Drokin wrote: >> On Jun 8, 2016, at 6:58 AM, Jeff Layton wrote: >> >>> A simple way to confirm that might be to convert all of the read locks >>> on the st_rwsem to write locks. That will serialize all of

Re: Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-08 Thread Jeff Layton
On Wed, 2016-06-08 at 12:10 -0400, Oleg Drokin wrote: > On Jun 8, 2016, at 6:58 AM, Jeff Layton wrote: > > > A simple way to confirm that might be to convert all of the read locks > > on the st_rwsem to write locks. That will serialize all of the open > > operations and should prevent that

Re: Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-08 Thread Jeff Layton
On Wed, 2016-06-08 at 12:10 -0400, Oleg Drokin wrote: > On Jun 8, 2016, at 6:58 AM, Jeff Layton wrote: > > > A simple way to confirm that might be to convert all of the read locks > > on the st_rwsem to write locks. That will serialize all of the open > > operations and should prevent that

Re: Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-08 Thread Oleg Drokin
On Jun 8, 2016, at 6:58 AM, Jeff Layton wrote: > A simple way to confirm that might be to convert all of the read locks > on the st_rwsem to write locks. That will serialize all of the open > operations and should prevent that particular race from occurring. > > If that works, we'd probably

Re: Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-08 Thread Oleg Drokin
On Jun 8, 2016, at 6:58 AM, Jeff Layton wrote: > A simple way to confirm that might be to convert all of the read locks > on the st_rwsem to write locks. That will serialize all of the open > operations and should prevent that particular race from occurring. > > If that works, we'd probably

Re: Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-08 Thread Oleg Drokin
On Jun 8, 2016, at 6:58 AM, Jeff Layton wrote: > On Tue, 2016-06-07 at 22:22 -0400, Oleg Drokin wrote: >> On Jun 7, 2016, at 8:03 PM, Jeff Layton wrote: >> > That said, this code is quite subtle. I'd need to look over it in more > detail before I offer up any fixes. I'd also appreciate

Re: Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-08 Thread Oleg Drokin
On Jun 8, 2016, at 6:58 AM, Jeff Layton wrote: > On Tue, 2016-06-07 at 22:22 -0400, Oleg Drokin wrote: >> On Jun 7, 2016, at 8:03 PM, Jeff Layton wrote: >> > That said, this code is quite subtle. I'd need to look over it in more > detail before I offer up any fixes. I'd also appreciate

Re: Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-08 Thread Jeff Layton
On Tue, 2016-06-07 at 22:22 -0400, Oleg Drokin wrote: > On Jun 7, 2016, at 8:03 PM, Jeff Layton wrote: > > > > > That said, this code is quite subtle. I'd need to look over it in more > > > > detail before I offer up any fixes. I'd also appreciate it if anyone > > > > else wants to sanity check

Re: Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-08 Thread Jeff Layton
On Tue, 2016-06-07 at 22:22 -0400, Oleg Drokin wrote: > On Jun 7, 2016, at 8:03 PM, Jeff Layton wrote: > > > > > That said, this code is quite subtle. I'd need to look over it in more > > > > detail before I offer up any fixes. I'd also appreciate it if anyone > > > > else wants to sanity check

Re: Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-07 Thread Oleg Drokin
On Jun 7, 2016, at 10:22 PM, Oleg Drokin wrote: > > On Jun 7, 2016, at 8:03 PM, Jeff Layton wrote: > That said, this code is quite subtle. I'd need to look over it in more detail before I offer up any fixes. I'd also appreciate it if anyone else wants to sanity check my analysis

Re: Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-07 Thread Oleg Drokin
On Jun 7, 2016, at 10:22 PM, Oleg Drokin wrote: > > On Jun 7, 2016, at 8:03 PM, Jeff Layton wrote: > That said, this code is quite subtle. I'd need to look over it in more detail before I offer up any fixes. I'd also appreciate it if anyone else wants to sanity check my analysis

Re: Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-07 Thread Oleg Drokin
On Jun 7, 2016, at 8:03 PM, Jeff Layton wrote: >>> That said, this code is quite subtle. I'd need to look over it in more >>> detail before I offer up any fixes. I'd also appreciate it if anyone >>> else wants to sanity check my analysis there. >>> > Yeah, I think you're right. It's fine since

Re: Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-07 Thread Oleg Drokin
On Jun 7, 2016, at 8:03 PM, Jeff Layton wrote: >>> That said, this code is quite subtle. I'd need to look over it in more >>> detail before I offer up any fixes. I'd also appreciate it if anyone >>> else wants to sanity check my analysis there. >>> > Yeah, I think you're right. It's fine since

Re: Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-07 Thread Oleg Drokin
On Jun 7, 2016, at 8:03 PM, Jeff Layton wrote: > On Tue, 2016-06-07 at 19:39 -0400, Oleg Drokin wrote: >> On Jun 7, 2016, at 4:04 PM, Jeff Layton wrote: >>> So, the way this is supposed to work is that the stateids each hold a >>> reference to the nfs4_file. They also take an fi_access reference

Re: Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-07 Thread Oleg Drokin
On Jun 7, 2016, at 8:03 PM, Jeff Layton wrote: > On Tue, 2016-06-07 at 19:39 -0400, Oleg Drokin wrote: >> On Jun 7, 2016, at 4:04 PM, Jeff Layton wrote: >>> So, the way this is supposed to work is that the stateids each hold a >>> reference to the nfs4_file. They also take an fi_access reference

Re: Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-07 Thread Jeff Layton
On Tue, 2016-06-07 at 19:39 -0400, Oleg Drokin wrote: > On Jun 7, 2016, at 4:04 PM, Jeff Layton wrote: > > > > > On Tue, 2016-06-07 at 13:30 -0400, Oleg Drokin wrote: > > > > > > On Jun 7, 2016, at 1:10 PM, Jeff Layton wrote: > > > > > > > > > > > > > > > On Tue, 2016-06-07 at 11:37 -0400,

Re: Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-07 Thread Jeff Layton
On Tue, 2016-06-07 at 19:39 -0400, Oleg Drokin wrote: > On Jun 7, 2016, at 4:04 PM, Jeff Layton wrote: > > > > > On Tue, 2016-06-07 at 13:30 -0400, Oleg Drokin wrote: > > > > > > On Jun 7, 2016, at 1:10 PM, Jeff Layton wrote: > > > > > > > > > > > > > > > On Tue, 2016-06-07 at 11:37 -0400,

Re: Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-07 Thread Oleg Drokin
On Jun 7, 2016, at 4:04 PM, Jeff Layton wrote: > On Tue, 2016-06-07 at 13:30 -0400, Oleg Drokin wrote: >> On Jun 7, 2016, at 1:10 PM, Jeff Layton wrote: >> >>> >>> On Tue, 2016-06-07 at 11:37 -0400, Oleg Drokin wrote: Hello! I've been trying to better understand this

Re: Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-07 Thread Oleg Drokin
On Jun 7, 2016, at 4:04 PM, Jeff Layton wrote: > On Tue, 2016-06-07 at 13:30 -0400, Oleg Drokin wrote: >> On Jun 7, 2016, at 1:10 PM, Jeff Layton wrote: >> >>> >>> On Tue, 2016-06-07 at 11:37 -0400, Oleg Drokin wrote: Hello! I've been trying to better understand this

Re: Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-07 Thread Jeff Layton
On Tue, 2016-06-07 at 13:30 -0400, Oleg Drokin wrote: > On Jun 7, 2016, at 1:10 PM, Jeff Layton wrote: > > > > > On Tue, 2016-06-07 at 11:37 -0400, Oleg Drokin wrote: > > > > > > Hello! > > > > > >    I've been trying to better understand this problem I was having where > > > sometimes > > >  

Re: Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-07 Thread Jeff Layton
On Tue, 2016-06-07 at 13:30 -0400, Oleg Drokin wrote: > On Jun 7, 2016, at 1:10 PM, Jeff Layton wrote: > > > > > On Tue, 2016-06-07 at 11:37 -0400, Oleg Drokin wrote: > > > > > > Hello! > > > > > >    I've been trying to better understand this problem I was having where > > > sometimes > > >  

Re: Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-07 Thread Oleg Drokin
On Jun 7, 2016, at 1:10 PM, Jeff Layton wrote: > On Tue, 2016-06-07 at 11:37 -0400, Oleg Drokin wrote: >> Hello! >> >>I've been trying to better understand this problem I was having where >> sometimes >>a formerly NFS-exported mountpoint becomes unmountable (after nfsd stop). >> >>

Re: Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-07 Thread Oleg Drokin
On Jun 7, 2016, at 1:10 PM, Jeff Layton wrote: > On Tue, 2016-06-07 at 11:37 -0400, Oleg Drokin wrote: >> Hello! >> >>I've been trying to better understand this problem I was having where >> sometimes >>a formerly NFS-exported mountpoint becomes unmountable (after nfsd stop). >> >>

Re: Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-07 Thread Jeff Layton
On Tue, 2016-06-07 at 11:37 -0400, Oleg Drokin wrote: > Hello! > >    I've been trying to better understand this problem I was having where > sometimes >    a formerly NFS-exported mountpoint becomes unmountable (after nfsd stop). > >    I finally traced it to a leaked filedescriptor that was

Re: Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-07 Thread Jeff Layton
On Tue, 2016-06-07 at 11:37 -0400, Oleg Drokin wrote: > Hello! > >    I've been trying to better understand this problem I was having where > sometimes >    a formerly NFS-exported mountpoint becomes unmountable (after nfsd stop). > >    I finally traced it to a leaked filedescriptor that was

Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-07 Thread Oleg Drokin
Hello! I've been trying to better understand this problem I was having where sometimes a formerly NFS-exported mountpoint becomes unmountable (after nfsd stop). I finally traced it to a leaked filedescriptor that was allocated from

Files leak from nfsd in 4.7.1-rc1 (and more?)

2016-06-07 Thread Oleg Drokin
Hello! I've been trying to better understand this problem I was having where sometimes a formerly NFS-exported mountpoint becomes unmountable (after nfsd stop). I finally traced it to a leaked filedescriptor that was allocated from