linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To: petkovbb@gmail.com
Cc: fujita.tomonori@lab.ntt.co.jp, linux-ide@vger.kernel.org,
	bzolnier@gmail.com
Subject: Re: [PATCH 06/11] ide: make ide_do_drive_cmd return rq->errors
Date: Wed, 23 Apr 2008 17:25:12 +0900	[thread overview]
Message-ID: <20080423171232U.tomof@acm.org> (raw)
In-Reply-To: <20080423073222.GB7482@gollum.tnic>

On Wed, 23 Apr 2008 09:32:22 +0200
Borislav Petkov <petkovbb@googlemail.com> wrote:

> Hi,
> 
> On Tue, Apr 22, 2008 at 09:26:37AM +0900, FUJITA Tomonori wrote:
> > ide_do_drive_cmd forges an error value (-EIO) instead of
> > rq->errors. idetape_queue_rw_tail wants rq->errors so this patch makes
> > ide_do_drive_cmd return rq->errors.
> > 
> > For compatibility, this patch makes the users of ide_do_drive_cmd
> > return -EIO instead of a return value of ide_do_drive_cmd
> > (rq->errors).
> 
> i don't see the reason for it. In the end, the only error type that is being
> handed to and fro is -EIO and nobody is interested in rq->errors. So, whether
> ide_do_drive_cmd or its callers return -EIO is kinda unimportant. In the second
> case, however, you have simply added more code (as per the diffstat below) with
> no apparent functionality. It would only make sense, IMHO, if you would
> differentiate behaviour based on rq->errors...

I did this only because idetape_queue_rw_tail seems to have
differentiate behaviour based on rq->errors:


static int idetape_queue_rw_tail(ide_drive_t *drive, int cmd, int blocks,
				 struct idetape_bh *bh)
{
...

	(void) ide_do_drive_cmd(drive, &rq, ide_wait);

	if ((cmd & (REQ_IDETAPE_READ | REQ_IDETAPE_WRITE)) == 0)
		return 0;

	if (tape->merge_stage)
		idetape_init_merge_stage(tape);
	if (rq.errors == IDETAPE_ERROR_GENERAL)
		return -EIO;


If we can do something like:

	ret = ide_do_drive_cmd(drive, &rq, ide_wait);

	if ((cmd & (REQ_IDETAPE_READ | REQ_IDETAPE_WRITE)) == 0)
		return 0;

	if (tape->merge_stage)
		idetape_init_merge_stage(tape);
	if (ret)
		return -EIO;


Then yeah, we don't need this patch.

  reply	other threads:[~2008-04-23  8:25 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-22  0:26 [PATCH 00/11] removing the on-stack struct request FUJITA Tomonori
2008-04-22  0:26 ` [PATCH 01/11] ide: use blk_get_request in the ide_do_drive_cmd path using ide_wait FUJITA Tomonori
2008-04-22  0:26   ` [PATCH 02/11] ide-floppy: use blk_get_request in the ide_do_drive_cmd path FUJITA Tomonori
2008-04-22  0:26     ` [PATCH 03/11] ide-taskfile: " FUJITA Tomonori
2008-04-22  0:26       ` [PATCH 04/11] ide-disk: " FUJITA Tomonori
2008-04-22  0:26         ` [PATCH 05/11] ide-cd: convert ide_cd_queue_pc to use blk_get_request FUJITA Tomonori
2008-04-22  0:26           ` [PATCH 06/11] ide: make ide_do_drive_cmd return rq->errors FUJITA Tomonori
2008-04-22  0:26             ` [PATCH 07/11] ide-tape: use blk_get_request in the ide_do_drive_cmd path FUJITA Tomonori
2008-04-22  0:26               ` [PATCH 08/11] ide-cd: " FUJITA Tomonori
2008-04-22  0:26                 ` [PATCH 09/11] ide: call blk_put_request properly FUJITA Tomonori
2008-04-22  0:26                   ` [PATCH 10/11] block: convert pd to use blk_get_request FUJITA Tomonori
2008-04-22  0:26                     ` [PATCH 11/11] block: remove the checking for NULL queue in blk_put_request FUJITA Tomonori
2008-04-23  7:31               ` [PATCH 07/11] ide-tape: use blk_get_request in the ide_do_drive_cmd path Borislav Petkov
2008-04-23  8:25                 ` FUJITA Tomonori
2008-04-23 10:20                   ` Boris Petkov
2008-04-23  7:32             ` [PATCH 06/11] ide: make ide_do_drive_cmd return rq->errors Borislav Petkov
2008-04-23  8:25               ` FUJITA Tomonori [this message]
2008-04-23 10:27                 ` Boris Petkov
2008-04-22  9:14 ` [PATCH 00/11] removing the on-stack struct request Bartlomiej Zolnierkiewicz
2008-04-23  7:40   ` Borislav Petkov
2008-04-23  7:43     ` Jens Axboe
2008-04-23  8:25     ` FUJITA Tomonori
2008-04-23  8:27       ` Jens Axboe
2008-04-23 10:32         ` Boris Petkov

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=20080423171232U.tomof@acm.org \
    --to=fujita.tomonori@lab.ntt.co.jp \
    --cc=bzolnier@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=petkovbb@gmail.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;
as well as URLs for NNTP newsgroup(s).