[PATCH] lockdep: annotate pktcdvd natural device hierarchy
authorArjan van de Ven <arjan@linux.intel.com>
Sun, 30 Jul 2006 10:03:30 +0000 (03:03 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 31 Jul 2006 20:28:39 +0000 (13:28 -0700)
The pkt_*_dev functions operate on not-this-blockdevice, and that is
sufficiently checked at setup time.  As a result there is a natural
hierarchy, which needs nesting annotations

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: Peter Osterlund <petero2@telia.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/block/pktcdvd.c

index bde2c64b634660b0a49057b127ce5e05a97c8cc1..451b996bba91e53bc934cc54048951015acc9868 100644 (file)
@@ -2577,19 +2577,19 @@ static int pkt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cm
        case PKT_CTRL_CMD_SETUP:
                if (!capable(CAP_SYS_ADMIN))
                        return -EPERM;
-               mutex_lock(&ctl_mutex);
+               mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
                ret = pkt_setup_dev(&ctrl_cmd);
                mutex_unlock(&ctl_mutex);
                break;
        case PKT_CTRL_CMD_TEARDOWN:
                if (!capable(CAP_SYS_ADMIN))
                        return -EPERM;
-               mutex_lock(&ctl_mutex);
+               mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
                ret = pkt_remove_dev(&ctrl_cmd);
                mutex_unlock(&ctl_mutex);
                break;
        case PKT_CTRL_CMD_STATUS:
-               mutex_lock(&ctl_mutex);
+               mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
                pkt_get_status(&ctrl_cmd);
                mutex_unlock(&ctl_mutex);
                break;