Re: [PATCH] fs/fs-writeback.c: not WARN on unregistered BDI

From: Ming Lei
Date: Mon Jul 27 2020 - 04:14:37 EST


On Thu, Jun 11, 2020 at 03:22:51PM +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.
>
> It should be normal for __mark_inode_dirty to see un-registered BDI,
> so kill the WARN().
>
> Cc: Alexander Viro <viro@xxxxxxxxxxxxxxxxxx>
> Cc: Christoph Hellwig <hch@xxxxxx>
> Cc: Brian Foster <bfoster@xxxxxxxxxx>
> Cc: Dave Chinner <dchinner@xxxxxxxxxx>
> Cc: Jens Axboe <axboe@xxxxxxxxx>
> Cc: linux-block@xxxxxxxxxxxxxxx
> Signed-off-by: Ming Lei <ming.lei@xxxxxxxxxx>
> ---
> fs/fs-writeback.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
> index a605c3dddabc..5e718580d4bf 100644
> --- a/fs/fs-writeback.c
> +++ b/fs/fs-writeback.c
> @@ -2318,10 +2318,6 @@ 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));
> -
> inode->dirtied_when = jiffies;
> if (dirtytime)
> inode->dirtied_time_when = jiffies;

Hello Alexander,

Could you merge this patch if you are fine?

Thanks,
Ming