+ lockdep-annotate-the-sysfs-i_mutex-to-be-a-separate-class.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     lockdep: annotate the sysfs i_mutex to be a separate class

has been added to the -mm tree.  Its filename is

     lockdep-annotate-the-sysfs-i_mutex-to-be-a-separate-class.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: lockdep: annotate the sysfs i_mutex to be a separate class
From: Arjan van de Ven <arjan@xxxxxxxxxxxxxxx>

sysfs has a different i_mutex lock order behavior for i_mutex than the
other filesystems; sysfs i_mutex is called in many places with subsystem
locks held.  At the same time, many of the VFS locking rules do not apply
to sysfs at all (cross directory rename for example).  To untangle this
mess (which gives false positives in lockdep), we're giving sysfs inodes
their own class for i_mutex.

Signed-off-by: Arjan van de Ven <arjan@xxxxxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
Cc: Greg KH <greg@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 fs/sysfs/inode.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff -puN fs/sysfs/inode.c~lockdep-annotate-the-sysfs-i_mutex-to-be-a-separate-class fs/sysfs/inode.c
--- a/fs/sysfs/inode.c~lockdep-annotate-the-sysfs-i_mutex-to-be-a-separate-class
+++ a/fs/sysfs/inode.c
@@ -109,6 +109,17 @@ static inline void set_inode_attr(struct
 	inode->i_ctime = iattr->ia_ctime;
 }
 
+
+/*
+ * sysfs has a different i_mutex lock order behavior for i_mutex than other
+ * filesystems; sysfs i_mutex is called in many places with subsystem locks
+ * held. At the same time, many of the VFS locking rules do not apply to
+ * sysfs at all (cross directory rename for example). To untangle this mess
+ * (which gives false positives in lockdep), we're giving sysfs inodes their
+ * own class for i_mutex.
+ */
+static struct lock_class_key sysfs_inode_imutex_key;
+
 struct inode * sysfs_new_inode(mode_t mode, struct sysfs_dirent * sd)
 {
 	struct inode * inode = new_inode(sysfs_sb);
@@ -117,6 +128,7 @@ struct inode * sysfs_new_inode(mode_t mo
 		inode->i_mapping->a_ops = &sysfs_aops;
 		inode->i_mapping->backing_dev_info = &sysfs_backing_dev_info;
 		inode->i_op = &sysfs_inode_operations;
+		lockdep_set_class(&inode->i_mutex, &sysfs_inode_imutex_key);
 
 		if (sd->s_iattr) {
 			/* sysfs_dirent has non-default attributes
_

Patches currently in -mm which might be from arjan@xxxxxxxxxxxxxxx are

origin.patch
improve-lockdep-debug-output.patch
lockdep-core-reduce-per-lock-class-cache-size.patch
put-a-comment-at-register_die_notifier-that-the-export-is-used.patch
disable-lock-debugging-when-kernel-state-becomes-untrusted.patch
git-acpi.patch
lockdep-annotate-8390c-disable_irq-2.patch
lockdep-fix-sk_dst_check-deadlock.patch
lockdep-split-the-skb_queue_head_init-lock-class.patch
fix-deadlock-in-the-bluetooth-l2cap-layer.patch
sleazy-fpu-feature-x86_64-support.patch
sleazy-fpu-feature-i386-support.patch
lockdep-annotate-the-sysfs-i_mutex-to-be-a-separate-class.patch
delay-accounting-taskstats-interface-send-tgid-once.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux