Thread (2 messages) 2 messages, 2 authors, 2017-11-02

Re: [PATCH] bcache: add a comment in journal bucket reading

From: Michael Lyle <hidden>
Date: 2017-11-02 16:31:34
Also in: linux-bcache

Tang--

On 11/01/2017 08:08 PM, tang.junhui@zte.com.cn wrote:
From: Tang Junhui <redacted>

Journal bucket is a circular buffer, the bucket
can be like YYYNNNYY, which means the first valid journal in
the 7th bucket, and the latest valid journal in third bucket, in
this case, if we do not try we the zero index first, We
may get a valid journal in the 7th bucket, then we call
find_next_bit(bitmap,ca->sb.njournal_buckets, l + 1) to get the
first invalid bucket after the 7th bucket, because all these
buckets is valid, so no bit 1 in bitmap, thus find_next_bit()
function would return with ca->sb.njournal_buckets (8). So, after
that, bcache only read journal in 7th and 8the bucket,
the first to the third buckets are lost.

So, it is important to let developer know that, we need to try
the zero index at first in the hash-search, and avoid any breaks
in future's code modification.

Signed-off-by: Tang Junhui <redacted>
Fixed a small whitespace error at end of line.

Reviewed-by: Michael Lyle <redacted>

Thank you for making this much more clear.

Mike
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help