All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: Boaz Harrosh <bharrosh@panasas.com>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	open-osd mailing-list <osd-dev@open-osd.org>
Subject: Re: [PATCH ver2 printk_ratelimit] bsg: Error print if device is not bidi capable when refusing a bidi command
Date: Tue, 20 Jan 2009 15:46:08 +0100	[thread overview]
Message-ID: <20090120144608.GQ30821@kernel.dk> (raw)
In-Reply-To: <4975E1EE.5070101@panasas.com>

On Tue, Jan 20 2009, Boaz Harrosh wrote:
> 
> If a bidi command was issued to a request_queue not mark as
> QUEUE_FLAG_BIDI. Issue an error report. This is a misconfiguration
> an administrator would like to know about, which is otherwise
> hard to detect.
> 
> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
> ---
>  block/bsg.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/block/bsg.c b/block/bsg.c
> index 44a2a0f..1da14fe 100644
> --- a/block/bsg.c
> +++ b/block/bsg.c
> @@ -270,6 +270,11 @@ bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr, fmode_t has_write_perm,
>  
>  	if (rw == WRITE && hdr->din_xfer_len) {
>  		if (!test_bit(QUEUE_FLAG_BIDI, &q->queue_flags)) {
> +			if (printk_ratelimit()) {
> +				printk(KERN_ERR
> +					"bsg: Attempt to send a bidi command "
> +					"to a none bidi device\n");
> +			}
>  			ret = -EOPNOTSUPP;
>  			goto out;
>  		}
> -- 
> 1.6.0.1

Thanks, that works. But why isn't the -EOPNOTSUPP error return (which the
app can see and print info about) enough? Do we really need to put this
in the kernel log?

-- 
Jens Axboe


  reply	other threads:[~2009-01-20 14:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-20 14:13 [PATCH] bsg: Error print if device is not bidi capable when refusing a bidi command Boaz Harrosh
2009-01-20 14:15 ` Jens Axboe
2009-01-20 14:38   ` [PATCH ver2 printk_ratelimit] " Boaz Harrosh
2009-01-20 14:46     ` Jens Axboe [this message]
2009-01-20 15:01       ` Boaz Harrosh
2009-01-20 15:31         ` Boaz Harrosh
2009-01-21  7:53           ` Jens Axboe
2009-01-20 23:10     ` FUJITA Tomonori
2009-01-20 14:41   ` [PATCH] " Boaz Harrosh

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=20090120144608.GQ30821@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=bharrosh@panasas.com \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=linux-scsi@vger.kernel.org \
    --cc=osd-dev@open-osd.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.