archive mirror
 help / color / mirror / Atom feed
From: Joe Thornber <>
To: LVM general discussion and development <>
Cc: David Teigland <>
Subject: Re: [linux-lvm] resend patch - bcache may mistakenly write data to another disk when writes error
Date: Mon, 28 Oct 2019 15:43:13 +0000	[thread overview]
Message-ID: <20191028154313.ibspu6qwqqsq54cc@reti> (raw)
In-Reply-To: <>

On Thu, Oct 24, 2019 at 03:06:18AM +0000, Heming Zhao wrote:
> First fail is in bcache_flush, then bcache_invalidate_fd does nothing because the data
> in cache->errored, which not belongs to dirty & clean list. Then the data mistakenly
> move from cache->errored into cache->dirty by "bcache_get => _lookup_or_read_block"
> (because the data holds BF_DIRTY flag).

I just pushed a couple of patches that will hopefully fix this issue for you:

commit 6b0d969b2a85ba69046afa26af4d7bcddddbccd5 (HEAD -> master, origin/master, origin/HEAD, 2019-10-11-bcache-purge)
Author: Joe Thornber <>
Date:   Mon Oct 28 15:01:47 2019 +0000

    [label] Use bcache_abort_fd() to ensure blocks are no longer in the cache.
    The return value from bcache_invalidate_fd() was not being checked.
    So I've introduced a little function, _invalidate_fd() that always
    calls bcache_abort_fd() if the write fails.

commit 2938b4dcca0a1df661758abfab7f402ea7aab018
Author: Joe Thornber <>
Date:   Mon Oct 28 14:29:47 2019 +0000

    [bcache] add bcache_abort()
    This gives us a way to cope with write failures.

Also there are big changes to bcache coming, that remove file descriptors from
the interface completely.  See the branch 2019-09-05-add-io-manager for more info
(bcache has been renamed io_manager).

- Joe

  reply	other threads:[~2019-10-28 15:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-22  9:47 [linux-lvm] resend patch - bcache may mistakenly write data to another disk when writes error Heming Zhao
2019-10-23 21:31 ` Joe Thornber
2019-10-24  3:06   ` Heming Zhao
2019-10-28 15:43     ` Joe Thornber [this message]
2019-10-29  5:07       ` Heming Zhao
2019-10-29  9:46         ` Heming Zhao
2019-10-29 11:05           ` Joe Thornber
2019-10-29 11:47             ` Heming Zhao
2019-10-29 14:41               ` Joe Thornber
2019-10-29 11:01         ` Joe Thornber
2019-10-29 11:41           ` Heming Zhao
2019-10-24  3:13   ` Heming Zhao
2019-10-28  8:38     ` Heming Zhao
     [not found] <>
     [not found] ` <>
2019-11-12 15:21   ` David Teigland
     [not found]     ` <>
2019-11-13 15:41       ` David Teigland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191028154313.ibspu6qwqqsq54cc@reti \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).