Linux-Fsdevel Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] fs/fs-writeback.c: don't WARN on unregistered BDI
@ 2020-06-11  2:44 Ming Lei
  2020-06-11  5:40 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Ming Lei @ 2020-06-11  2:44 UTC (permalink / raw)
  To: linux-fsdevel
  Cc: Ming Lei, Alexander Viro, Christoph Hellwig, Brian Foster,
	Dave Chinner, Jens Axboe, linux-block

BDI is unregistered from del_gendisk() which is usually done in device's
release handler from device hotplug or error handling context, so BDI
can be unregistered anytime.

It should be normal for __mark_inode_dirty to see un-registered BDI,
so replace the WARN() with pr_debug() just for debug purpose.

Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Brian Foster <bfoster@redhat.com>
Cc: Dave Chinner <dchinner@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org
Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
 fs/fs-writeback.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index a605c3dddabc..5b7a5f5803ff 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -2318,9 +2318,10 @@ void __mark_inode_dirty(struct inode *inode, int flags)
 
 			wb = locked_inode_to_wb_and_lock_list(inode);
 
-			WARN(bdi_cap_writeback_dirty(wb->bdi) &&
-			     !test_bit(WB_registered, &wb->state),
-			     "bdi-%s not registered\n", bdi_dev_name(wb->bdi));
+			if (bdi_cap_writeback_dirty(wb->bdi) &&
+			     !test_bit(WB_registered, &wb->state))
+				pr_debug("bdi-%s not registered\n",
+						bdi_dev_name(wb->bdi));
 
 			inode->dirtied_when = jiffies;
 			if (dirtytime)
-- 
2.25.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] fs/fs-writeback.c: don't WARN on unregistered BDI
  2020-06-11  2:44 [PATCH] fs/fs-writeback.c: don't WARN on unregistered BDI Ming Lei
@ 2020-06-11  5:40 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2020-06-11  5:40 UTC (permalink / raw)
  To: Ming Lei
  Cc: linux-fsdevel, Alexander Viro, Christoph Hellwig, Brian Foster,
	Dave Chinner, Jens Axboe, linux-block

On Thu, Jun 11, 2020 at 10:44:17AM +0800, Ming Lei wrote:
> BDI is unregistered from del_gendisk() which is usually done in device's
> release handler from device hotplug or error handling context, so BDI
> can be unregistered anytime.

True.

> It should be normal for __mark_inode_dirty to see un-registered BDI,
> so replace the WARN() with pr_debug() just for debug purpose.

I'd kill it entirely while we're at it..

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-11  5:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-11  2:44 [PATCH] fs/fs-writeback.c: don't WARN on unregistered BDI Ming Lei
2020-06-11  5:40 ` Christoph Hellwig

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).