[PATCH] ashmem: Fix lockdep issue during llseek

2018-02-12 Thread Joel Fernandes
ashmem_mutex create a chain of dependencies like so: (1) mmap syscall -> mmap_sem -> (acquired) ashmem_mmap ashmem_mutex (try to acquire) (block) (2) llseek syscall -> ashmem_llseek -> ashmem_mutex -> (acquired) inode_lock -> inode->i_rwsem (try to acquire) (block) (3)

[PATCH] ashmem: Fix lockdep issue during llseek

2018-02-12 Thread Joel Fernandes
ashmem_mutex create a chain of dependencies like so: (1) mmap syscall -> mmap_sem -> (acquired) ashmem_mmap ashmem_mutex (try to acquire) (block) (2) llseek syscall -> ashmem_llseek -> ashmem_mutex -> (acquired) inode_lock -> inode->i_rwsem (try to acquire) (block) (3)

[PATCH] ashmem: Fix lockdep issue during llseek

2018-02-05 Thread Joel Fernandes
ashmem_mutex create a chain of dependencies like so: (1) mmap syscall -> mmap_sem -> (acquired) ashmem_mmap ashmem_mutex (try to acquire) (block) (2) llseek syscall -> ashmem_llseek -> ashmem_mutex -> (acquired) inode_lock -> inode->i_rwsem (try to acquire) (block) (3)

[PATCH] ashmem: Fix lockdep issue during llseek

2018-02-05 Thread Joel Fernandes
ashmem_mutex create a chain of dependencies like so: (1) mmap syscall -> mmap_sem -> (acquired) ashmem_mmap ashmem_mutex (try to acquire) (block) (2) llseek syscall -> ashmem_llseek -> ashmem_mutex -> (acquired) inode_lock -> inode->i_rwsem (try to acquire) (block) (3)

Re: [PATCH] ashmem: Fix lockdep issue during llseek

2018-01-26 Thread Joel Fernandes
Hi Al, On Fri, Jan 26, 2018 at 11:39 AM, Al Viro wrote: [..] > >> But one usecase for the mutex is with concurrent lseeks, you can end >> up with a file->f_pos that is different from the latest update to >> asma->file->f_pos. A barrier could fix this it too though. Any

Re: [PATCH] ashmem: Fix lockdep issue during llseek

2018-01-26 Thread Joel Fernandes
Hi Al, On Fri, Jan 26, 2018 at 11:39 AM, Al Viro wrote: [..] > >> But one usecase for the mutex is with concurrent lseeks, you can end >> up with a file->f_pos that is different from the latest update to >> asma->file->f_pos. A barrier could fix this it too though. Any >> thoughts? > > lseek(2)

Re: [PATCH] ashmem: Fix lockdep issue during llseek

2018-01-26 Thread Al Viro
On Fri, Jan 26, 2018 at 11:23:47AM -0800, Joel Fernandes wrote: > I was just trying to be careful with the least intrusive solution > since I'm not the original author of the driver. Sure, but that needs a proof that it *is* a solution... > But one usecase for the mutex is with concurrent

Re: [PATCH] ashmem: Fix lockdep issue during llseek

2018-01-26 Thread Al Viro
On Fri, Jan 26, 2018 at 11:23:47AM -0800, Joel Fernandes wrote: > I was just trying to be careful with the least intrusive solution > since I'm not the original author of the driver. Sure, but that needs a proof that it *is* a solution... > But one usecase for the mutex is with concurrent

Re: [PATCH] ashmem: Fix lockdep issue during llseek

2018-01-26 Thread Joel Fernandes
On Fri, Jan 26, 2018 at 11:23 AM, Joel Fernandes wrote: > Hi Al, > > On Thu, Jan 25, 2018 at 7:13 PM, Al Viro wrote: >> On Thu, Jan 25, 2018 at 06:46:49PM -0800, Joel Fernandes wrote: >>> ashmem_mutex create a chain of dependencies like so: >>> >>> (1)

Re: [PATCH] ashmem: Fix lockdep issue during llseek

2018-01-26 Thread Joel Fernandes
On Fri, Jan 26, 2018 at 11:23 AM, Joel Fernandes wrote: > Hi Al, > > On Thu, Jan 25, 2018 at 7:13 PM, Al Viro wrote: >> On Thu, Jan 25, 2018 at 06:46:49PM -0800, Joel Fernandes wrote: >>> ashmem_mutex create a chain of dependencies like so: >>> >>> (1) >>> mmap syscall -> >>> mmap_sem ->

Re: [PATCH] ashmem: Fix lockdep issue during llseek

2018-01-26 Thread Joel Fernandes
Hi Al, On Thu, Jan 25, 2018 at 7:13 PM, Al Viro wrote: > On Thu, Jan 25, 2018 at 06:46:49PM -0800, Joel Fernandes wrote: >> ashmem_mutex create a chain of dependencies like so: >> >> (1) >> mmap syscall -> >> mmap_sem -> (acquired) >> ashmem_mmap >> ashmem_mutex

Re: [PATCH] ashmem: Fix lockdep issue during llseek

2018-01-26 Thread Joel Fernandes
Hi Al, On Thu, Jan 25, 2018 at 7:13 PM, Al Viro wrote: > On Thu, Jan 25, 2018 at 06:46:49PM -0800, Joel Fernandes wrote: >> ashmem_mutex create a chain of dependencies like so: >> >> (1) >> mmap syscall -> >> mmap_sem -> (acquired) >> ashmem_mmap >> ashmem_mutex (try to acquire) >>

Re: [PATCH] ashmem: Fix lockdep issue during llseek

2018-01-25 Thread Al Viro
On Thu, Jan 25, 2018 at 06:46:49PM -0800, Joel Fernandes wrote: > ashmem_mutex create a chain of dependencies like so: > > (1) > mmap syscall -> > mmap_sem -> (acquired) > ashmem_mmap > ashmem_mutex (try to acquire) > (block) > > (2) > llseek syscall -> > ashmem_llseek -> >

Re: [PATCH] ashmem: Fix lockdep issue during llseek

2018-01-25 Thread Al Viro
On Thu, Jan 25, 2018 at 06:46:49PM -0800, Joel Fernandes wrote: > ashmem_mutex create a chain of dependencies like so: > > (1) > mmap syscall -> > mmap_sem -> (acquired) > ashmem_mmap > ashmem_mutex (try to acquire) > (block) > > (2) > llseek syscall -> > ashmem_llseek -> >

[PATCH] ashmem: Fix lockdep issue during llseek

2018-01-25 Thread Joel Fernandes
ashmem_mutex create a chain of dependencies like so: (1) mmap syscall -> mmap_sem -> (acquired) ashmem_mmap ashmem_mutex (try to acquire) (block) (2) llseek syscall -> ashmem_llseek -> ashmem_mutex -> (acquired) inode_lock -> inode->i_rwsem (try to acquire) (block) (3)

[PATCH] ashmem: Fix lockdep issue during llseek

2018-01-25 Thread Joel Fernandes
ashmem_mutex create a chain of dependencies like so: (1) mmap syscall -> mmap_sem -> (acquired) ashmem_mmap ashmem_mutex (try to acquire) (block) (2) llseek syscall -> ashmem_llseek -> ashmem_mutex -> (acquired) inode_lock -> inode->i_rwsem (try to acquire) (block) (3)