public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Miquel van Smoorenburg <miquels@cistron.nl>
Cc: James.Bottomley@SteelEye.com, linux-scsi@vger.kernel.org
Subject: Re: make sysfs scsi queue_depth read/write [patch]
Date: Wed, 14 Jan 2004 11:55:24 +0000	[thread overview]
Message-ID: <20040114115524.A29732@infradead.org> (raw)
In-Reply-To: <20040114114132.GA12621@cistron.nl>; from miquels@cistron.nl on Wed, Jan 14, 2004 at 12:41:34PM +0100

Patch looks okay, but the implementation would be

> +	struct scsi_device *sdev;
> +	if (sscanf(buf, "%d", &val) != 1)
> +		return -EINVAL;
> +	sdev = to_scsi_device(dev);
> +	if (!sdev

Can't be NULL.

|| val < 1 || val > sdev->host->cmd_per_lun)
> +		return -EINVAL;
> +	sdev->queue_depth = val;

This needs some locking.  Currently we have a single global lock protecting
queue_depth updates, but none for reads.   (which looks a bit racy already,
but no need to make it worse..)


  reply	other threads:[~2004-01-14 11:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-14 11:41 make sysfs scsi queue_depth read/write [patch] Miquel van Smoorenburg
2004-01-14 11:55 ` Christoph Hellwig [this message]
2004-01-14 12:21   ` Miquel van Smoorenburg
2004-01-14 14:56 ` James Bottomley
2004-01-14 15:37   ` Miquel van Smoorenburg

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=20040114115524.A29732@infradead.org \
    --to=hch@infradead.org \
    --cc=James.Bottomley@SteelEye.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=miquels@cistron.nl \
    /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