public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Douglas Gilbert <dougg@torque.net>
To: Jens Axboe <axboe@suse.de>
Cc: Fabio Coatti <cova@ferrara.linux.it>,
	akpm@osdl.org, lkml <linux-kernel@vger.kernel.org>,
	linux-scsi@vger.kernel.org
Subject: Re: 2.6.11-rc[1,2]-mmX scsi cdrom problem, 2.6.10-mm2 ok
Date: Mon, 31 Jan 2005 23:09:15 +1000	[thread overview]
Message-ID: <41FE2DFB.1090801@torque.net> (raw)
In-Reply-To: <20050131114943.GD5058@suse.de>

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

Jens Axboe wrote:
> On Mon, Jan 31 2005, Douglas Gilbert wrote:
> 
>>Jens Axboe wrote:
>>
>>>On Mon, Jan 31 2005, Fabio Coatti wrote:
>>>
>>>
>>>>Alle 09:00, lunedì 31 gennaio 2005, Jens Axboe ha scritto:
>>>>
>>>>
>>>>>>At this point k3b is stuck in D stat, needs reboot.

I was able to replicate this with a USB burner.
My system didn't need a reboot. The "D" state was locked
on "blk_execute_rq". The burner was still accessible via
sg.

>>>>>The most likely suspect is the REQ_BLOCK_PC scsi changes. Can you try
>>>>>2.6.11-rc2-mm1 with bk-scsi backed out? (attached)
>>>>
>>>>just tried, right guess :)
>>>>backing out that patch the problem disappears.
>>>>Let me know if you need to narrow further that issue.
>>>
>>>
>>>Doug, it looks like your REQ_BLOCK_PC changes are buggy. Let me know if
>>>you cannot find the full post and I'll forward it to you.
>>
>>Jens,
>>Hmm. Found the thread on lkml. I got an almost identical
>>lock up in k3b with a USB external cd/dvd drive recently.
>>My laptop didn't need rebooting (probably since the root
>>fs is one an ide disk).
>>
>>That is a quite large patch that you referenced. I'll
>>try and replicate and report back.
> 
> 
> My guess would be the scsi_lib changes, I would suggest you start there.

Indeed. I'm not sure what I was thinking in
scsi_io_completion(). This small reversion
fixes my k3b problem; tested with a USB external
burner.

Signed-off-by: Douglas Gilbert <dougg@torque.net>





[-- Attachment #2: scsi_lib2611rc2bk8.diff --]
[-- Type: text/x-patch, Size: 1233 bytes --]

--- linux/drivers/scsi/scsi_lib.c	2005-01-31 17:46:31.000000000 +1000
+++ linux/drivers/scsi/scsi_lib.c2611r2b8_k3b	2005-01-31 22:46:04.000000000 +1000
@@ -692,6 +692,7 @@
 	int this_count = cmd->bufflen;
 	request_queue_t *q = cmd->device->request_queue;
 	struct request *req = cmd->request;
+	int clear_errors = 1;
 	struct scsi_sense_hdr sshdr;
 	int sense_valid = 0;
 	int sense_deferred = 0;
@@ -721,6 +722,7 @@
 	if (blk_pc_request(req)) { /* SG_IO ioctl from block level */
 		req->errors = result;
 		if (result) {
+			clear_errors = 0;
 			if (sense_valid) {
 				/*
 				 * SG_IO wants current and deferred errors
@@ -745,11 +747,6 @@
 	cmd->request_buffer = NULL;
 	cmd->request_bufflen = 0;
 
-	if (blk_pc_request(req)) { /* SG_IO ioctl from block level */
-		scsi_end_request(cmd, 1, good_bytes, 0);
-		return;
-	}
-
 	/*
 	 * Next deal with any sectors which we were able to correctly
 	 * handle.
@@ -759,7 +756,8 @@
 					      req->nr_sectors, good_bytes));
 		SCSI_LOG_HLCOMPLETE(1, printk("use_sg is %d\n", cmd->use_sg));
 
-		req->errors = 0;
+		if (clear_errors)
+			req->errors = 0;
 		/*
 		 * If multiple sectors are requested in one buffer, then
 		 * they will have been finished off by the first command.

  reply	other threads:[~2005-01-31 13:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-30 23:34 2.6.11-rc[1,2]-mmX scsi cdrom problem, 2.6.10-mm2 ok Fabio Coatti
2005-01-31  8:00 ` Jens Axboe
2005-01-31 10:08   ` Fabio Coatti
2005-01-31 11:05     ` Jens Axboe
2005-01-31 11:49       ` Douglas Gilbert
2005-01-31 11:49         ` Jens Axboe
2005-01-31 13:09           ` Douglas Gilbert [this message]
2005-01-31 13:53             ` Jens Axboe

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=41FE2DFB.1090801@torque.net \
    --to=dougg@torque.net \
    --cc=akpm@osdl.org \
    --cc=axboe@suse.de \
    --cc=cova@ferrara.linux.it \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@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