[linux-lvm] resend patch - bcache may mistakenly write data to another disk when writes error

David Teigland teigland at redhat.com
Tue Nov 12 15:21:12 UTC 2019


On Tue, Nov 12, 2019 at 08:38:00AM +0000, Heming Zhao wrote:
> There still have bug codes wait for fixing.
> Please see below item <2>. the _last_byte_xx (in bcache.c) should be restored to ZERO when fail/error.
> Do you have any plan/schedule to this issue?
> Do you have any plan/schedule to backport these fixes to stable-2.02 branch?

I don't think it should actually be a problem since bcache_unset_last_byte
checks for _last_byte_fd == fd.  But, I think it's better to not rely on that
check, so how about a change like this?

void dev_unset_last_byte(struct device *dev)
{
        if (dev->bcache_fd > 0)
                bcache_unset_last_byte(scan_bcache, dev->bcache_fd);
}




More information about the linux-lvm mailing list