FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 12-03-2007, 10:12 PM
Kiyoshi Ueda
 
Default blk_end_request: changing ide normal caller (take 3)

Hi Bartlomiej,

On Sat, 1 Dec 2007 23:53:05 +0100, Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> wrote:
> On Saturday 01 December 2007, Kiyoshi Ueda wrote:
> > This patch converts "normal" parts of ide to use blk_end_request().
> >
> > Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
> > Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
> > ---
> > drivers/ide/ide-cd.c | 6 +++---
> > drivers/ide/ide-io.c | 17 ++++++-----------
> > 2 files changed, 9 insertions(+), 14 deletions(-)
>
> [...]
>
> > Index: 2.6.24-rc3-mm2/drivers/ide/ide-io.c
> > ================================================== =================
> > --- 2.6.24-rc3-mm2.orig/drivers/ide/ide-io.c
> > +++ 2.6.24-rc3-mm2/drivers/ide/ide-io.c
> > @@ -78,14 +78,9 @@ static int __ide_end_request(ide_drive_t
> > ide_dma_on(drive);
> > }
> >
> > - if (!end_that_request_chunk(rq, uptodate, nr_bytes)) {
> > - add_disk_randomness(rq->rq_disk);
> > - if (dequeue) {
> > - if (!list_empty(&rq->queuelist))
> > - blkdev_dequeue_request(rq);
> > + if (!__blk_end_request(rq, uptodate, nr_bytes)) {
> > + if (dequeue)
> > HWGROUP(drive)->rq = NULL;
> > - }
> > - end_that_request_last(rq, uptodate);
> > ret = 0;
> > }
>
> Hmmm, this seems to change the old behavior (the request should
> be dequeued from the queue only if 'dequeue' variable is set)
> and AFAIR some error handling code (in ide-cd?) depends on the
> old behavior so please revisit this patch.

blk_end_request() takes care of the dequeue like below,
so I think no problem. (Please see PATCH 01)

> + /* rq->queuelist of dequeued request should be list_empty() */
> + if (!list_empty(&rq->queuelist))
> + blkdev_dequeue_request(rq);

In the case of ide-cd,
o 'dequeue' variable is 1 only when the request is still linked
to the queue (i.e. rq->queuelist is not empty)
o 'dequeue' variable is 0 only when the request has already been
removed from the queue (i.e. rq->queuelist is empty)
So blk_end_request() can handle it correctly.


If there are any drivers which don't want dequeue the queued request,
the code above would not work.
But, as far as I investigated, I have never seen such a requirement
in device drivers.

Do you think that ide may still gets a problem for the 'dequeue'?

Thanks,
Kiyoshi Ueda

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 12-04-2007, 05:04 PM
Kiyoshi Ueda
 
Default blk_end_request: changing ide normal caller (take 3)

Hi Bartlomiej,

On Tue, 4 Dec 2007 14:47:00 +0100, Bartlomiej Zolnierkiewicz wrote:
> > > Hmmm, this seems to change the old behavior (the request should
> > > be dequeued from the queue only if 'dequeue' variable is set)
> > > and AFAIR some error handling code (in ide-cd?) depends on the
> > > old behavior so please revisit this patch.
> >
> > blk_end_request() takes care of the dequeue like below,
> > so I think no problem. (Please see PATCH 01)
> >
> > > + /* rq->queuelist of dequeued request should be list_empty() */
> > > + if (!list_empty(&rq->queuelist))
> > > + blkdev_dequeue_request(rq);
> >
> > In the case of ide-cd,
> > o 'dequeue' variable is 1 only when the request is still linked
> > to the queue (i.e. rq->queuelist is not empty)
> > o 'dequeue' variable is 0 only when the request has already been
> > removed from the queue (i.e. rq->queuelist is empty)
> > So blk_end_request() can handle it correctly.
>
> It would be helpful to add the above explanation to a patch description.
>
> > If there are any drivers which don't want dequeue the queued request,
> > the code above would not work.
> > But, as far as I investigated, I have never seen such a requirement
> > in device drivers.
> >
> > Do you think that ide may still gets a problem for the 'dequeue'?
>
> Everything seems to be fine now.
>
> Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

Thank you for the check.
OK, I'll add the explanation about the 'dequeue' to patch description.

Thanks,
Kiyoshi Ueda

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 11:28 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org