All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Xie Yongji <xieyongji@bytedance.com>
Cc: josef@toxicpanda.com, axboe@kernel.dk,
	linux-block@vger.kernel.org, nbd@other.debian.org,
	yixingchen@bytedance.com
Subject: Re: [PATCH] nbd: clear wb_err in bd_inode on disconnect
Date: Thu, 9 Sep 2021 07:31:00 +0100	[thread overview]
Message-ID: <YTmqJHd7YWAQ2lZ7@infradead.org> (raw)
In-Reply-To: <20210907121425.91-1-xieyongji@bytedance.com>

On Tue, Sep 07, 2021 at 08:14:25PM +0800, Xie Yongji wrote:
> When a nbd device encounters a writeback error, that error will
> get propagated to the bd_inode's wb_err field. Then if this nbd
> device's backend is disconnected and another is attached, we will
> get back the previous writeback error on fsync, which is unexpected.
> To fix it, let's clear out the wb_err on disconnect.

I really do not like how internals of the implementation like into
drivers here.  Can you add a block layer helper to clear any state
instead? This should incude e.g. the size just cleared above and should
also be used by the loop driver as well.

  reply	other threads:[~2021-09-09  6:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-07 12:14 [PATCH] nbd: clear wb_err in bd_inode on disconnect Xie Yongji
2021-09-09  6:31 ` Christoph Hellwig [this message]
2021-09-09 12:34   ` Yongji Xie

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=YTmqJHd7YWAQ2lZ7@infradead.org \
    --to=hch@infradead.org \
    --cc=axboe@kernel.dk \
    --cc=josef@toxicpanda.com \
    --cc=linux-block@vger.kernel.org \
    --cc=nbd@other.debian.org \
    --cc=xieyongji@bytedance.com \
    --cc=yixingchen@bytedance.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.