]> err.no Git - linux-2.6/commitdiff
[PATCH] lockdep: annotate sb ->s_umount
authorArjan van de Ven <arjan@infradead.org>
Mon, 3 Jul 2006 07:25:28 +0000 (00:25 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 3 Jul 2006 22:27:09 +0000 (15:27 -0700)
The s_umount rwsem needs to be classified as per-superblock since it's
perfectly legit to keep multiple of those recursively in the VFS locking
rules.

Has no effect on non-lockdep kernels.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/super.c
include/linux/fs.h

index 5a4fe8be462ad998d0f32cdf270f710d210d6326..6d4e8174b6db4fd7548b94403aafdd49043966f9 100644 (file)
@@ -72,6 +72,7 @@ static struct super_block *alloc_super(struct file_system_type *type)
                INIT_LIST_HEAD(&s->s_inodes);
                init_rwsem(&s->s_umount);
                mutex_init(&s->s_lock);
+               lockdep_set_class(&s->s_umount, &type->s_umount_key);
                /*
                 * The locking rules for s_lock are up to the
                 * filesystem. For example ext3fs has different
index 0a3ea52d711eb83d831e94300808e40712848aaa..e26de68059afc1f1a1b25488c12b0b24cf67342c 100644 (file)
@@ -1296,6 +1296,7 @@ struct file_system_type {
        struct file_system_type * next;
        struct list_head fs_supers;
        struct lock_class_key s_lock_key;
+       struct lock_class_key s_umount_key;
 };
 
 extern int get_sb_bdev(struct file_system_type *fs_type,