linux/fs/ext2
Arjan van de Ven 5c81a4197d [PATCH] lockdep: annotate the quota code
The quota code plays interesting games with the lock ordering; to quote Jan:

| i_mutex of inode containing quota file is acquired after all other
| quota locks. i_mutex of all other inodes is acquired before quota
| locks. Quota code makes sure (by resetting inode operations and
| setting special flag on inode) that noone tries to enter quota code
| while holding i_mutex on a quota file...

The good news is that all of this special case i_mutex grabbing happens in the
(per filesystem) low level quota write function.  For this special case we
need a new I_MUTEX_* nesting level, since this just entirely outside any of
the regular VFS locking rules for i_mutex.  I trust Jan on his blue eyes that
this is not ever going to deadlock; and based on that the patch below is what
it takes to inform lockdep of these very interesting new locking rules.

The new locking rule for the I_MUTEX_QUOTA nesting level is that this is the
deepest possible level of nesting for i_mutex, and that this only should be
used in quota write (and possibly read) function of filesystems.  This makes
the lock ordering of the I_MUTEX_* levels:

I_MUTEX_PARENT -> I_MUTEX_CHILD -> I_MUTEX_NORMAL -> I_MUTEX_QUOTA

Has no effect on non-lockdep kernels.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: Jan Kara <jack@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-03 15:27:08 -07:00
..
acl.c [PATCH] Fix two ext[23] uninitialized warnings 2006-02-03 08:32:05 -08:00
acl.h [PATCH] remove <linux/xattr_acl.h> 2005-06-23 09:45:33 -07:00
balloc.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
dir.c [PATCH] ext2: cleanup: put_page and comment fix 2006-06-25 10:01:25 -07:00
ext2.h [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
file.c [PATCH] Introduce sys_splice() system call 2006-03-30 12:28:18 -08:00
fsync.c [PATCH] ext2: cleanup: put_page and comment fix 2006-06-25 10:01:25 -07:00
ialloc.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
inode.c [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
ioctl.c [PATCH] capable/capability.h (fs/) 2006-01-11 18:42:13 -08:00
Makefile [PATCH] Make EXT2_DEBUG work again 2006-06-25 10:01:12 -07:00
namei.c [PATCH] ext2: switch to inode_inc_count, inode_dec_count 2006-03-23 07:38:16 -08:00
super.c [PATCH] lockdep: annotate the quota code 2006-07-03 15:27:08 -07:00
symlink.c Fix nasty ncpfs symlink handling bug. 2005-08-19 18:02:56 -07:00
xattr_security.c [PATCH] ext2: Enable atomic inode security labeling 2005-09-09 13:57:27 -07:00
xattr_trusted.c [PATCH] capable/capability.h (fs/) 2006-01-11 18:42:13 -08:00
xattr_user.c [PATCH] remove ext2 xattr permission checks 2006-01-10 08:01:30 -08:00
xattr.c [PATCH] fix deadlock in ext2 2006-02-17 13:59:26 -08:00
xattr.h Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
xip.c [PATCH] fix xip sparse file handling in ext2 2005-07-27 16:25:53 -07:00
xip.h [PATCH] xip: ext2: execute in place 2005-06-24 00:06:41 -07:00