Commit a0747a85 authored by weiping zhang's avatar weiping zhang Committed by Jens Axboe

bdi: add error handle for bdi_debug_register

In order to make error handle more cleaner we call bdi_debug_register
before set state to WB_registered, that we can avoid call bdi_unregister
in release_bdi().
Reviewed-by: default avatarJan Kara <>
Signed-off-by: default avatarweiping zhang <>
Signed-off-by: default avatarJens Axboe <>
parent 97f07697
......@@ -882,10 +882,13 @@ int bdi_register_va(struct backing_dev_info *bdi, const char *fmt, va_list args)
if (IS_ERR(dev))
return PTR_ERR(dev);
if (bdi_debug_register(bdi, dev_name(dev))) {
device_destroy(bdi_class, dev->devt);
return -ENOMEM;
bdi->dev = dev;
bdi_debug_register(bdi, dev_name(dev));
set_bit(WB_registered, &bdi->wb.state);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment