public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Patrick Mansfield <patmans@us.ibm.com>
To: Jeremy Higdon <jeremy@sgi.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	Matthew Wilcox <willy@debian.org>, Christoph Hellwig <hch@lst.de>,
	Emoore@lsil.com, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] sg.c to set direction more reliably  (was Re: [PATCH] fusion update to current APIs)
Date: Tue, 15 Jun 2004 10:42:35 -0700	[thread overview]
Message-ID: <20040615104235.A21082@beaverton.ibm.com> (raw)
In-Reply-To: <20040615093148.GA179519@sgi.com>; from jeremy@sgi.com on Tue, Jun 15, 2004 at 02:31:48AM -0700

On Tue, Jun 15, 2004 at 02:31:48AM -0700, Jeremy Higdon wrote:
> On Tue, Jun 15, 2004 at 02:10:43AM -0700, Jeremy Higdon wrote:
> > One more comment from hch via IRC.  When we have to guess direction,
> > print a suggestion to use SG v3 interface.

But print only once, so borked applications that continually poll devices
won't generate lots of these messages.

> +	/*
> +	 * If data direction is indeterminate because both input and output size
> +	 * are greater than 0, use command bytes to determine direction.
> +	 */
> +	if (input_size == 0 && mxsize > 0)
> +		hp->dxfer_direction = SG_DXFER_FROM_DEV;
> +	else if (input_size > 0 && old_hdr.reply_len <= SZ_SG_HEADER)
> +		hp->dxfer_direction = SG_DXFER_TO_DEV;
> +	else if (input_size == 0 && mxsize == 0)
> +		hp->dxfer_direction = SG_DXFER_NONE;
> +	else {
> +		hp->dxfer_direction = sg_direction(cmnd);
> +		printk("sg_write: cannot infer direction from count %ld "
> +		       "and reply_len %d; inferring from command 0x%x.  Please "
> +		       "fix the application to use the sg version 3 interface\n",
> +		       count, old_hdr.reply_len, (unsigned int) cmnd[0]);
> +	}
>  	k = sg_common_write(sfp, srp, cmnd, sfp->timeout, blocking);
>  	return (k < 0) ? k : count;
>  }

      reply	other threads:[~2004-06-15 17:43 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-31 11:52 [PATCH] fusion update to current APIs Christoph Hellwig
2004-06-12  0:36 ` Jeremy Higdon
2004-06-12  3:45   ` Matthew Wilcox
2004-06-12  5:13     ` Jeremy Higdon
2004-06-12  5:20       ` Matthew Wilcox
2004-06-15  6:08         ` [PATCH] sg.c to set direction more reliably (was Re: [PATCH] fusion update to current APIs) Jeremy Higdon
2004-06-15  6:47           ` Douglas Gilbert
2004-06-15  7:41             ` Jeremy Higdon
2004-06-15 15:07               ` Jeff Garzik
2004-06-15 21:34                 ` Jeremy Higdon
2004-06-15 22:10                   ` Jeff Garzik
2004-06-15 22:15                   ` Jeremy Higdon
2004-08-26  7:09                     ` Jeremy Higdon
2004-08-26  8:44                       ` Douglas Gilbert
2004-08-27  1:12                         ` Jeremy Higdon
2004-08-27  8:10                           ` Jeremy Higdon
2004-08-28  5:08                             ` Douglas Gilbert
2004-08-28  9:39                               ` Jeremy Higdon
2004-08-30  7:08                                 ` [PATCH] sg.c to warn about ambiguous data direction Jeremy Higdon
2004-06-15  6:54           ` [PATCH] sg.c to set direction more reliably (was Re: [PATCH] fusion update to current APIs) Jeff Garzik
2004-06-15  7:50             ` Jeremy Higdon
2004-06-15  7:57               ` Arjan van de Ven
2004-06-15  8:40                 ` Jeremy Higdon
2004-06-15  8:17           ` Christoph Hellwig
2004-06-15  8:48             ` Jeremy Higdon
2004-06-15  9:10               ` Jeremy Higdon
2004-06-15  9:31                 ` Jeremy Higdon
2004-06-15 17:42                   ` Patrick Mansfield [this message]

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=20040615104235.A21082@beaverton.ibm.com \
    --to=patmans@us.ibm.com \
    --cc=Emoore@lsil.com \
    --cc=hch@infradead.org \
    --cc=hch@lst.de \
    --cc=jeremy@sgi.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=willy@debian.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