From: Arjan van de Ven Date: Mon, 3 Jul 2006 07:25:28 +0000 (-0700) Subject: [PATCH] lockdep: annotate sb ->s_umount X-Git-Tag: v2.6.18-rc1~41 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=897c6ff9568bcb102ffc6b465ebe1def0cba829d;p=platform%2Fupstream%2Fkernel-adaptation-pc.git [PATCH] lockdep: annotate sb ->s_umount 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 Signed-off-by: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/super.c b/fs/super.c index 5a4fe8b..6d4e817 100644 --- a/fs/super.c +++ b/fs/super.c @@ -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 diff --git a/include/linux/fs.h b/include/linux/fs.h index 0a3ea52..e26de6805 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -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,