Messages in this thread | | | Date | Tue, 15 Dec 2009 22:21:34 +0000 | From | Al Viro <> | Subject | Re: NFS lockdep lock misordering mmap_sem<->i_mutex_key with 2.6.32-git1 |
| |
On Mon, Dec 07, 2009 at 02:20:09PM +0100, Andi Kleen wrote: > > nfs_readdir > > nfs_do_filldir > > filldir > > copy_to_user > > [page_fault] [grab mmap_sem] > > > > sys_mmap [grab mmap_sem] > > do_mmap_pgoff > > mmap_region > > nfs_file_mmap > > nfs_revalidate_mapping > > nfs_invalidate_mapping [grab i_mutex] > > > > I guess recent lockdep improvement find old bug. > > Thanks for the analysis. > > I guess should never do copy_*_user while holding i_mutex? There might > be lots of cases like that.
No. mmap_sem inside i_mutex is the normal order; NFS mmap is doing the wrong thing here. Note that readdir() vs. NFS (file-only, thankfully ;-) mmap() is a non-issue; NFS mmap() vs. write() is much more interesting.
Again, a lot of mm/* code expects i_mutex, then mmap_sem order. It's not just readdir().
| |