linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: Eric Windisch <eric@grokthis.net>
Cc: linux-ide@vger.kernel.org
Subject: Re: Libata-tj-stable patch /w sil3124 and PMP... 'device or resource busy'
Date: Sun, 27 Aug 2006 18:35:12 +0900	[thread overview]
Message-ID: <44F16750.5080100@gmail.com> (raw)
In-Reply-To: <44E28313.7050601@grokthis.net>

[-- Attachment #1: Type: text/plain, Size: 757 bytes --]

Eric Windisch wrote:
>> Can you post the result of 'dmesg'
> 
> Attached as dmesg.log
> 
>> 'cat /proc/mounts' and 
> 
> Attached as proc.mounts.txt
> 
> 
>> 'fuser -v /dev/sdX#'?
> 
> root@san001:~# fuser -v /dev/sda1
> root@san001:~# fuser -v /dev/sdb1
> root@san001:~# fuser -v /dev/sdc1
> root@san001:~# fuser -v /dev/sdd1
> root@san001:~# fuser -v /dev/sde1
> root@san001:~# fuser -v /dev/sde
> root@san001:~# fuser -v /dev/sdd
> root@san001:~# fuser -v /dev/sdc
> root@san001:~# fuser -v /dev/sdb
> root@san001:~# fuser -v /dev/sda
> root@san001:~# fuser -v /dev/sd*
> root@san001:~#
> 
> And for good measure...
> 
> root@san001:~# lsof /dev/sd*
> root@san001:~#

Can you apply the attached patch and report what the kernel says?

Thanks.

-- 
tejun

[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 2258 bytes --]

diff --git a/fs/block_dev.c b/fs/block_dev.c
index f5958f4..c4fae17 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -452,16 +452,23 @@ int bd_claim(struct block_device *bdev, 
 	/* first decide result */
 	if (bdev->bd_holder == holder)
 		res = 0;	 /* already a holder */
-	else if (bdev->bd_holder != NULL)
+	else if (bdev->bd_holder != NULL) {
+		printk("XXX bd_claim %d:%d failed %d@%p\n",
+		       MAJOR(bdev->bd_dev), MINOR(bdev->bd_dev),
+		       bdev->bd_holders, bdev->bd_holder);
 		res = -EBUSY; 	 /* held by someone else */
+	}
 	else if (bdev->bd_contains == bdev)
 		res = 0;  	 /* is a whole device which isn't held */
 
 	else if (bdev->bd_contains->bd_holder == bd_claim)
 		res = 0; 	 /* is a partition of a device that is being partitioned */
-	else if (bdev->bd_contains->bd_holder != NULL)
+	else if (bdev->bd_contains->bd_holder != NULL) {
+		printk("XXX bd_claim %d:%d failed %d@%p (part of a held dev)\n",
+		       MAJOR(bdev->bd_dev), MINOR(bdev->bd_dev),
+		       bdev->bd_holders, bdev->bd_holder);
 		res = -EBUSY;	 /* is a partition of a held device */
-	else
+	} else
 		res = 0;	 /* is a partition of an un-held device */
 
 	/* now impose change */
@@ -474,6 +481,14 @@ int bd_claim(struct block_device *bdev, 
 		bdev->bd_contains->bd_holder = bd_claim;
 		bdev->bd_holders++;
 		bdev->bd_holder = holder;
+		printk("XXX bd_claim %d:%d/%d:%d %d@%p %d@%p\n",
+		       MAJOR(bdev->bd_dev), MINOR(bdev->bd_dev),
+		       MAJOR(bdev->bd_contains->bd_dev),
+		       MINOR(bdev->bd_contains->bd_dev),
+		       bdev->bd_holders, bdev->bd_holder,
+		       bdev->bd_contains->bd_holders,
+		       bdev->bd_contains->bd_holder);
+		dump_stack();
 	}
 	spin_unlock(&bdev_lock);
 	return res;
@@ -484,6 +499,12 @@ EXPORT_SYMBOL(bd_claim);
 void bd_release(struct block_device *bdev)
 {
 	spin_lock(&bdev_lock);
+	printk("XXX bd_release %d:%d/%d:%d %d@%p %d@%p\n",
+	       MAJOR(bdev->bd_dev), MINOR(bdev->bd_dev),
+	       MAJOR(bdev->bd_contains->bd_dev),
+	       MINOR(bdev->bd_contains->bd_dev),
+	       bdev->bd_holders, bdev->bd_holder,
+	       bdev->bd_contains->bd_holders, bdev->bd_contains->bd_holder);
 	if (!--bdev->bd_contains->bd_holders)
 		bdev->bd_contains->bd_holder = NULL;
 	if (!--bdev->bd_holders)

  reply	other threads:[~2006-08-27  9:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-14 23:22 Libata-tj-stable patch /w sil3124 and PMP... 'device or resource busy' Eric Windisch
2006-08-15 12:55 ` Tejun Heo
2006-08-16  2:29   ` Eric Windisch
2006-08-27  9:35     ` Tejun Heo [this message]
2006-08-28  1:16       ` Eric Windisch
2006-08-29  2:55         ` Tejun Heo
2006-08-29 14:58           ` Eric Windisch
2006-08-29 14:57             ` Tejun Heo
2006-08-29 15:15               ` Eric Windisch

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=44F16750.5080100@gmail.com \
    --to=htejun@gmail.com \
    --cc=eric@grokthis.net \
    --cc=linux-ide@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).