kernel-ark/fs
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
..
9p Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
adfs Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
affs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
afs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
autofs [PATCH] VFS: Permit filesystem to override root dentry on mount 2006-06-23 07:42:45 -07:00
autofs4 [PATCH] fs: use list_move() 2006-06-26 09:58:18 -07:00
befs typo fixes: aquire -> acquire 2006-06-30 18:23:04 +02:00
bfs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
cifs Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
coda Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
configfs configfs: Clear up a few extra spaces where there should be TABs. 2006-06-29 14:43:01 -07:00
cramfs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
debugfs Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
devpts [PATCH] VFS: Permit filesystem to override root dentry on mount 2006-06-23 07:42:45 -07:00
efs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
exportfs
ext2 [PATCH] lockdep: annotate the quota code 2006-07-03 15:27:08 -07:00
ext3 [PATCH] lockdep: annotate the quota code 2006-07-03 15:27:08 -07:00
fat [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
freevxfs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
fuse [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
hfs Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
hfsplus Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
hostfs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
hpfs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
hppfs [PATCH] VFS: Permit filesystem to perform statfs with a known root dentry 2006-06-23 07:42:45 -07:00
hugetlbfs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
isofs Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
jbd [PATCH] add poison.h and patch primary users 2006-06-27 17:32:38 -07:00
jffs Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
jffs2 Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
jfs Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
lockd Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
minix [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
msdos [PATCH] VFS: Permit filesystem to override root dentry on mount 2006-06-23 07:42:45 -07:00
ncpfs Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2006-06-30 15:39:30 -07:00
nfs [PATCH] nfs: non-procfs build fix 2006-07-02 15:10:20 -07:00
nfs_common
nfsd Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2006-06-30 15:39:30 -07:00
nls Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
ntfs [PATCH] lockdep: annotate NTFS locking rules 2006-07-03 15:27:08 -07:00
ocfs2 ocfs2: remove redundant NULL checks in ocfs2_direct_IO_get_blocks() 2006-06-29 16:13:35 -07:00
openpromfs [OPENPROMFS]: Rewrite using in-kernel device tree and seq_file. 2006-06-25 23:19:14 -07:00
partitions Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
proc Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2006-06-30 15:39:30 -07:00
qnx4 Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
ramfs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
reiserfs [PATCH] lockdep: annotate the quota code 2006-07-03 15:27:08 -07:00
romfs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
smbfs Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
sysfs [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
sysv [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
udf Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
ufs [PATCH] lockdep: annotate the quota code 2006-07-03 15:27:08 -07:00
vfat [PATCH] VFS: Permit filesystem to override root dentry on mount 2006-06-23 07:42:45 -07:00
xfs Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
aio.c spelling fixes 2006-06-26 18:35:02 +02:00
attr.c
bad_inode.c
binfmt_aout.c
binfmt_elf_fdpic.c [PATCH] frv: binfmt_elf_fdpic __user annotations 2006-06-23 07:42:54 -07:00
binfmt_elf.c [PATCH] binfmt_elf: fix checks for bad address 2006-07-03 15:26:59 -07:00
binfmt_em86.c
binfmt_flat.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
binfmt_misc.c Merge branch 'master' of /home/trondmy/kernel/linux-2.6/ 2006-06-24 13:07:53 -04:00
binfmt_script.c
binfmt_som.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
bio.c [PATCH] Fix missing ret assignment in __bio_map_user() error path 2006-06-17 10:52:12 -07:00
block_dev.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
buffer.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2006-06-30 15:39:30 -07:00
char_dev.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
compat_ioctl.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
compat.c [PATCH] x86_64: Add compat_printk and sysctl to turn off compat layer warnings 2006-06-26 10:48:16 -07:00
dcache.c [PATCH] lockdep: annotate dcache 2006-07-03 15:27:06 -07:00
dcookies.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
direct-io.c [PATCH] lockdep: annotate direct io 2006-07-03 15:27:06 -07:00
dnotify.c
dquot.c [PATCH] use list_add_tail() instead of list_add() 2006-06-26 09:58:17 -07:00
drop_caches.c
eventpoll.c [PATCH] epoll: use unlocked wqueue operations 2006-06-25 10:01:13 -07:00
exec.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
fcntl.c
fifo.c
file_table.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
file.c
filesystems.c
fs-writeback.c [PATCH] zoned vm counters: conversion of nr_unstable to per zone counter 2006-06-30 11:25:36 -07:00
inode.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2006-06-30 15:39:30 -07:00
inotify_user.c [PATCH] VFS: Permit filesystem to override root dentry on mount 2006-06-23 07:42:45 -07:00
inotify.c [PATCH] inotify (4/5): allow watch removal from event handler 2006-06-20 05:25:19 -04:00
ioctl.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
ioprio.c [PATCH] SELinux: Add security hook definition for getioprio and insert hooks 2006-06-30 11:25:37 -07:00
Kconfig ocfs2: OCFS2_FS must depend on SYSFS 2006-06-29 14:56:12 -07:00
Kconfig.binfmt
libfs.c [PATCH] core: use list_move() 2006-06-26 09:58:17 -07:00
locks.c [PATCH] fs/locks.c: make posix_locks_deadlock() static 2006-06-23 07:43:03 -07:00
Makefile [PATCH] devfs: Remove devfs from the kernel tree 2006-06-26 12:25:05 -07:00
mbcache.c
mpage.c [PATCH] writeback: fix range handling 2006-06-23 07:42:49 -07:00
namei.c [PATCH] lockdep: annotate i_mutex 2006-07-03 15:27:06 -07:00
namespace.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
nfsctl.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
open.c [PATCH] ftruncate does not always update m/ctime 2006-06-25 10:01:15 -07:00
pipe.c [PATCH] VFS: Permit filesystem to override root dentry on mount 2006-06-23 07:42:45 -07:00
pnode.c [PATCH] core: use list_move() 2006-06-26 09:58:17 -07:00
pnode.h
posix_acl.c
quota_v1.c
quota_v2.c
quota.c
read_write.c
readdir.c
select.c [PATCH] fs: sys_poll with timeout -1 bug fix 2006-06-25 10:01:22 -07:00
seq_file.c
splice.c [PATCH] splice: retrieve mapping after locking the page 2006-06-23 17:10:39 +02:00
stat.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
super.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
sync.c [PATCH] writeback: fix range handling 2006-06-23 07:42:49 -07:00
xattr_acl.c
xattr.c [PATCH] log more info for directory entry change events 2006-06-20 05:25:28 -04:00