Re: [PATCH] bcache: correct journal bucket reading

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tang--

I think the scenario you listed can't happen, because the first bucket
we try in the hash-search is 0.  If the circular buffer has wrapped,
that will be detected immediately and we'll leave the loop with l=0.
We should add a comment that we need to try the first index first for
correctness so that we don't inadvertently change this behavior.

One thing took me a long time to convince myself was safe with the
original code:  If we have 'YYNYYYYYYY', we'll start at l=0, and then
we'll search across the N;  I think this is OK because sequence
numbers will cause us to do the right thing.

Mike

On Wed, Nov 1, 2017 at 12:10 AM,  <tang.junhui@xxxxxxxxxx> wrote:
> From: Tang Junhui <tang.junhui@xxxxxxxxxx>
>
> Hello Mike, Coly
>
> I found this issue by code reading.
> It looks serious.
> May I am wrong.
> Please have a review.
>
> Thanks,
> Tang
>
>



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux