Linux-bcache Archive mirror
 help / color / mirror / Atom feed
From: Coly Li <colyli@suse.de>
To: Mingzhe Zou <mingzhe.zou@easystack.cn>
Cc: Eric Wheeler <bcache@lists.ewheeler.net>,
	Bcache Linux <linux-bcache@vger.kernel.org>,
	zoumingzhe@qq.com
Subject: Re: [PATCH v2] bcache: fixup init dirty data errors
Date: Fri, 25 Aug 2023 00:31:31 +0800	[thread overview]
Message-ID: <29E994AF-48BB-42E1-819A-DD0F1B0C5343@suse.de> (raw)
In-Reply-To: <20230824125730.3273-1-mingzhe.zou@easystack.cn>



> 2023年8月24日 20:57,Mingzhe Zou <mingzhe.zou@easystack.cn> 写道:
> 
> We found that after long run, the dirty_data of the bcache device
> will have errors. This error cannot be eliminated unless re-register.
> 
> We also found that reattach after detach, this error can accumulate.
> 
> In bch_sectors_dirty_init(), all inode <= d->id keys will be recounted
> again. This is wrong, we only need to count the keys of the current
> device.
> 

I will refine the commit log a bit.


> Fixes: b144e45fc576 ("bcache: make bch_sectors_dirty_init() to be multithreaded")
> Signed-off-by: Mingzhe Zou <mingzhe.zou@easystack.cn>

Added into my for-next directory.

Thanks for the fix up!

Coly Li


> ---
> drivers/md/bcache/writeback.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/writeback.c
> index 24c049067f61..4a1079da95b2 100644
> --- a/drivers/md/bcache/writeback.c
> +++ b/drivers/md/bcache/writeback.c
> @@ -991,8 +991,11 @@ void bch_sectors_dirty_init(struct bcache_device *d)
> op.count = 0;
> 
> for_each_key_filter(&c->root->keys,
> -    k, &iter, bch_ptr_invalid)
> +    k, &iter, bch_ptr_invalid) {
> + if (KEY_INODE(k) != op.inode)
> + continue;
> sectors_dirty_init_fn(&op.op, c->root, k);
> + }
> 
> rw_unlock(0, c->root);
> return;
> -- 
> 2.17.1.windows.2
> 


      reply	other threads:[~2023-08-24 16:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-24 12:57 [PATCH v2] bcache: fixup init dirty data errors Mingzhe Zou
2023-08-24 16:31 ` Coly Li [this message]

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=29E994AF-48BB-42E1-819A-DD0F1B0C5343@suse.de \
    --to=colyli@suse.de \
    --cc=bcache@lists.ewheeler.net \
    --cc=linux-bcache@vger.kernel.org \
    --cc=mingzhe.zou@easystack.cn \
    --cc=zoumingzhe@qq.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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 read-only IMAP folder(s) and NNTP newsgroup(s).