public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@SteelEye.com>
To: akpm@osdl.org
Cc: linux-scsi@vger.kernel.org, suzuki@in.ibm.com
Subject: Re: [patch 1/1] drivers/scsi: fix proc_scsi_write to return "length" on success with remove-single-device case
Date: Thu, 27 Apr 2006 14:07:49 -0500	[thread overview]
Message-ID: <1146164869.3528.20.camel@mulgrave.il.steeleye.com> (raw)
In-Reply-To: <200604262138.k3QLchcv009103@shell0.pdx.osdl.net>

On Wed, 2006-04-26 at 14:41 -0700, akpm@osdl.org wrote:
> +               if (!err)
> +                       err = length;

We have more than one of these cases; we might as well accommodate them
all at the bottom of the routine, like the attached

James

diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c
index 07be62b..55200e4 100644
--- a/drivers/scsi/scsi_proc.c
+++ b/drivers/scsi/scsi_proc.c
@@ -266,8 +266,6 @@ static ssize_t proc_scsi_write(struct fi
 		lun = simple_strtoul(p + 1, &p, 0);
 
 		err = scsi_add_single_device(host, channel, id, lun);
-		if (err >= 0)
-			err = length;
 
 	/*
 	 * Usage: echo "scsi remove-single-device 0 1 2 3" >/proc/scsi/scsi
@@ -284,6 +282,13 @@ static ssize_t proc_scsi_write(struct fi
 		err = scsi_remove_single_device(host, channel, id, lun);
 	}
 
+	/*
+	 * convert success returns so that we return the 
+	 * number of bytes consumed.
+	 */
+	if (!err)
+		err = length;
+
  out:
 	free_page((unsigned long)buffer);
 	return err;



      reply	other threads:[~2006-04-27 19:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-26 21:41 [patch 1/1] drivers/scsi: fix proc_scsi_write to return "length" on success with remove-single-device case akpm
2006-04-27 19:07 ` James Bottomley [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=1146164869.3528.20.camel@mulgrave.il.steeleye.com \
    --to=james.bottomley@steeleye.com \
    --cc=akpm@osdl.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=suzuki@in.ibm.com \
    /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