* Re-drive buffer head more than once
@ 2003-05-01 16:52 Zhihui Zhang
2003-05-02 8:16 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Zhihui Zhang @ 2003-05-01 16:52 UTC (permalink / raw)
To: linux-kernel
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?
Thanks for any enlightment!
-Zhihui
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Re-drive buffer head more than once
2003-05-01 16:52 Re-drive buffer head more than once Zhihui Zhang
@ 2003-05-02 8:16 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2003-05-02 8:16 UTC (permalink / raw)
To: Zhihui Zhang; +Cc: linux-kernel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-05-02 8:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-01 16:52 Re-drive buffer head more than once Zhihui Zhang
2003-05-02 8:16 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox