public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: Mike Christie <michaelc@cs.wisc.edu>
Cc: SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] return all status bytes for sg io.
Date: Wed, 2 Jun 2004 21:31:59 +0200	[thread overview]
Message-ID: <20040602193158.GB2401@suse.de> (raw)
In-Reply-To: <40BDC726.7070004@cs.wisc.edu>

On Wed, Jun 02 2004, Mike Christie wrote:
> Hi Jens,
> 
> For block/scsi_ioctl.c only the status_byte is returned. However, when sg 
> io is performed through a sg device the host, msg and driver bytes are 
> passed back. I was not sure if this is a bug on the block layers part 
> (becuase as you see in the patch, after the msg, host and driver bytes are 
> zerod out they are tested), or is the bug in the app and it should be 
> modifed to access sg devices instead of block devs. The attached patch was 
> built against 2.6.7-rc2.
> 
> Thanks,
> 
> Mike

> diff -arup linux-2.6.7-rc2/drivers/block/scsi_ioctl.c linux-2.6.7-rc2-work/drivers/block/scsi_ioctl.c
> --- linux-2.6.7-rc2/drivers/block/scsi_ioctl.c	2004-05-29 23:26:48.000000000 -0700
> +++ linux-2.6.7-rc2-work/drivers/block/scsi_ioctl.c	2004-06-02 04:32:27.000000000 -0700
> @@ -185,11 +185,11 @@ static int sg_io(request_queue_t *q, str
>  	blk_execute_rq(q, bd_disk, rq);
>  
>  	/* write to all output members */
> -	hdr->status = rq->errors;	
> -	hdr->masked_status = (hdr->status >> 1) & 0x1f;
> -	hdr->msg_status = 0;
> -	hdr->host_status = 0;
> -	hdr->driver_status = 0;
> +	hdr->status = 0xff & rq->errors;
> +	hdr->masked_status = status_byte(rq->errors);
> +	hdr->msg_status = msg_byte(rq->errors);
> +	hdr->host_status = host_byte(rq->errors);
> +	hdr->driver_status = driver_byte(rq->errors);

For SCSI, this looks good. I need to look at ide-cd to be sure it's ok,
did you verify this?

-- 
Jens Axboe


  reply	other threads:[~2004-06-02 19:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-02 12:25 [PATCH] return all status bytes for sg io Mike Christie
2004-06-02 19:31 ` Jens Axboe [this message]
2004-06-02 23:42   ` Mike Christie

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=20040602193158.GB2401@suse.de \
    --to=axboe@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=michaelc@cs.wisc.edu \
    /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