lkml.org 
[lkml]   [2003]   [May]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Re-drive buffer head more than once
On Thu, May 01 2003, Zhihui Zhang wrote:
> Hi,
>
> Is it legal to call general_make_request() more than once on the same bh?
> What will happen if a previous request is still in the queue, or just
> initiated but not finished yet? If I call general_make_request() on the
> same buffer 10 times, does it mean the same buffer will *always* be
> written 10 times on the disk?

It's not legal to call generic_make_request() on a buffer_head, if you
have not acquired the BH_Lock first. The buffer_head will be unlocked on
IO completion, so that basically tells you that you cannot issue more
than _one_ generic_make_request() on a buffer_head.

If you fail to comply with that, then you will basically corrupt the
existing request in the queue where the buffer is attached. You _must_
do a lock_buffer() before calling generic_make_request.

--
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:35    [W:0.037 / U:1.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site