Peter Zijlstra 14358e6dda lockdep: annotate dir vs file i_mutex
On Mon, 2007-09-24 at 22:13 -0400, Steven Rostedt wrote:
> The circular lock seems to be this:
> 
> #1:
> 
>   sys_mmap2:              down_write(&mm->mmap_sem);
>   nfs_revalidate_mapping: mutex_lock(&inode->i_mutex);
> 
> 
> #0:
> 
>   vfs_readdir:     mutex_lock(&inode->i_mutex);
>    - during the readdir (filldir64), we take a user fault (missing page?)
>     and call do_page_fault -
>   do_page_fault:   down_read(&mm->mmap_sem);
> 
> 
> So it does indeed look like a circular locking. Now the question is, "is
> this a bug?".  Looking like the inode of #1 must be a file or something
> else that you can mmap and the inode of #0 seems it must be a directory.
> I would say "no".
> 
> Now if you can readdir on a file or mmap a directory, then this could be
> an issue.
> 
> Otherwise, I'd love to see someone teach lockdep about this issue! ;-)

Make a distinction between file and dir usage of i_mutex.
The inode should be complete and unused at unlock_new_inode(), re-init
i_mutex depending on its type.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
2007-10-14 01:38:33 +02:00
..
2007-10-09 19:59:16 -07:00
2007-09-24 07:15:48 +02:00
2007-07-19 10:04:52 -07:00
2007-09-23 22:17:27 +02:00
2007-10-10 16:53:11 -07:00
2007-09-11 04:22:16 -07:00
2007-07-19 10:04:43 -07:00
2007-10-10 16:51:59 -07:00
2007-10-10 16:49:02 -07:00
2007-07-19 10:04:45 -07:00
2007-07-31 10:43:05 -05:00
2007-07-10 17:18:59 -07:00
2007-07-16 09:05:46 -07:00
2007-07-17 10:23:04 -07:00
2007-05-10 18:24:13 +02:00
2007-05-08 11:15:25 -07:00
2007-05-08 11:15:26 -07:00
2007-07-09 08:22:54 +01:00
2007-07-09 08:23:17 +01:00
2007-07-19 10:04:54 -07:00
2007-07-12 10:55:56 -07:00
2007-07-17 10:23:06 -07:00
2007-06-01 08:18:29 -07:00
2007-07-16 09:05:52 -07:00
2007-05-09 08:57:56 +02:00
2007-07-16 09:05:52 -07:00
2007-07-18 09:15:20 -04:00
2007-07-18 09:15:20 -04:00
2007-07-17 10:23:13 -07:00
2007-07-16 09:05:45 -07:00
2007-10-14 01:38:33 +02:00
2007-07-18 18:29:37 -04:00
2007-07-16 09:05:41 -07:00
2007-06-18 09:48:41 -07:00
2007-07-17 10:22:59 -07:00
2007-07-10 00:35:17 -04:00
2007-07-09 18:51:58 +02:00
2007-10-14 14:47:56 +02:00
2007-10-14 14:47:26 +02:00
2007-07-19 10:04:41 -07:00
2007-10-13 23:56:33 +02:00
2007-07-16 09:05:34 -07:00
2007-10-10 16:51:59 -07:00
2007-07-14 18:55:06 -07:00
2007-10-10 16:52:04 -07:00
2007-10-14 12:41:52 -07:00
2007-10-14 13:40:02 +02:00
2007-07-16 09:05:50 -07:00
2007-07-16 09:05:47 -07:00
2007-07-31 15:39:41 -07:00
2007-10-11 22:11:12 +02:00
2007-07-11 15:03:53 +01:00
2007-10-12 23:04:23 +02:00
2007-08-26 18:35:34 -07:00
2007-09-04 23:16:04 -04:00
2007-07-18 08:47:40 -07:00
2007-10-12 14:51:12 -07:00
2007-05-09 12:30:53 -07:00
2007-10-13 10:18:29 +02:00
2007-09-11 22:24:45 +01:00
2007-07-17 10:23:03 -07:00
2007-07-17 10:23:13 -07:00
2007-05-18 20:46:30 -07:00
2007-07-24 12:24:59 -07:00
2007-07-16 09:05:34 -07:00
2007-07-18 08:47:45 -07:00
2007-05-08 11:15:18 -07:00
2007-05-09 12:30:49 -07:00
2007-10-10 16:54:03 -07:00
2007-07-16 09:05:42 -07:00
2007-10-11 22:11:12 +02:00
2007-07-19 10:04:45 -07:00
2007-07-16 09:05:51 -07:00
2007-05-09 12:30:54 -07:00
2007-07-20 13:41:56 +10:00
2007-05-08 11:15:14 -07:00
2007-07-26 11:35:21 -07:00
2007-07-26 11:35:21 -07:00
2007-07-16 09:05:50 -07:00
2007-07-16 09:05:46 -07:00
2007-07-17 10:23:03 -07:00
2007-05-09 08:57:56 +02:00
2007-07-18 08:47:40 -07:00
2007-07-21 18:37:10 -07:00
2007-05-17 05:23:06 -07:00
2007-05-08 11:15:18 -07:00
2007-07-16 09:05:50 -07:00
2007-07-22 11:03:37 -07:00
2007-09-20 13:19:59 -07:00
2007-09-16 16:21:16 -07:00
2007-07-20 12:33:44 -07:00
2007-05-21 21:47:27 -07:00
2007-07-16 09:05:45 -07:00
2007-07-16 09:05:46 -07:00
2007-07-19 10:04:49 -07:00
2007-07-16 09:05:40 -07:00
2007-05-08 11:15:18 -07:00
2007-07-18 08:47:40 -07:00
2007-05-09 12:30:57 -07:00
2007-05-11 08:29:34 -07:00
2007-07-31 15:39:39 -07:00
2007-10-12 14:51:12 -07:00
2007-05-11 08:29:36 -07:00
2007-07-20 11:23:02 -07:00
2007-05-11 08:29:35 -07:00
2007-05-11 08:29:35 -07:00
2007-07-18 15:57:15 -07:00
2007-09-19 11:24:18 -07:00
2007-07-17 10:22:59 -07:00
2007-07-09 18:52:01 +02:00
2007-10-10 09:25:57 +02:00