mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@linux.intel.com>
To: Peter Osterlund <petero2@telia.com>
Cc: mingo@elte.hu, akpm@osdl.org,
	Laurent Riffard <laurent.riffard@free.fr>,
	Kernel development list <linux-kernel@vger.kernel.org>,
	axboe@suse.de
Subject: [patch] lockdep: annotate pktcdvd natural device hierarchy
Date: Sat, 15 Jul 2006 09:04:58 +0200	[thread overview]
Message-ID: <1152947098.3114.9.camel@laptopd505.fenrus.org> (raw)
In-Reply-To: <m3odvrc2vo.fsf@telia.com>


> So the claim from the lockdep code, "BUG: possible circular locking
> deadlock detected!", is a false alarm.

ok this patch ought to kill the false positive:


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>

Index: linux-2.6.18-rc1/drivers/block/pktcdvd.c
===================================================================
--- linux-2.6.18-rc1.orig/drivers/block/pktcdvd.c
+++ linux-2.6.18-rc1/drivers/block/pktcdvd.c
@@ -2577,19 +2577,19 @@ static int pkt_ctl_ioctl(struct inode *i
 	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;


  parent reply	other threads:[~2006-07-15  7:05 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-08 19:09 2.6.17-rc6-mm1/pktcdvd - BUG: possible circular locking Laurent Riffard
2006-06-12 15:14 ` Arjan van de Ven
2006-06-12 16:41   ` Jens Axboe
2006-06-21 10:21     ` Arjan van de Ven
2006-06-22 14:50   ` Peter Osterlund
2006-06-22 18:20     ` Arjan van de Ven
2006-07-14 11:22       ` Peter Osterlund
2006-07-14 13:46         ` Arjan van de Ven
2006-07-14 21:06           ` Peter Osterlund
2006-07-14 22:29             ` Arjan van de Ven
2006-07-15  7:04             ` Arjan van de Ven [this message]
2006-07-15 10:35               ` [patch] lockdep: annotate pktcdvd natural device hierarchy Laurent Riffard
2006-07-15 10:57                 ` Peter Osterlund
2006-07-16 10:33                   ` Laurent Riffard
2006-07-25  2:27                     ` Andrew Morton
2006-07-25  5:34                       ` Arjan van de Ven
2006-07-25  6:31                         ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1152947098.3114.9.camel@laptopd505.fenrus.org \
    --to=arjan@linux.intel.com \
    --cc=akpm@osdl.org \
    --cc=axboe@suse.de \
    --cc=laurent.riffard@free.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=petero2@telia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®