Whamcloud - gitweb
LU-15901 mdc: Remove entry from list before freeing 80/47480/3
authorOleg Drokin <green@whamcloud.com>
Mon, 30 May 2022 07:05:23 +0000 (03:05 -0400)
committerOleg Drokin <green@whamcloud.com>
Mon, 27 Jun 2022 04:24:48 +0000 (04:24 +0000)
mdc_changelog_cdev_init forgot to remove entries from list if
chardev allocation failed

Change-Id: Ic76b5320bf80c7f7f60c7682bda4bc37a0b300bd
Fixes: d0423abc1ad ("LU-12506 changelog: support large number of MDT")
Signed-off-by: Oleg Drokin <green@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/47480
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
lustre/mdc/mdc_changelog.c

index 843c4de..853bee2 100644 (file)
@@ -826,7 +826,7 @@ int mdc_changelog_cdev_init(struct obd_device *obd)
 
        rc = chlg_minor_alloc(&minor);
        if (rc)
-               GOTO(out_unlock, rc);
+               GOTO(out_listrm, rc);
 
        device_initialize(&entry->ced_device);
        entry->ced_device.devt = MKDEV(MAJOR(mdc_changelog_dev), minor);
@@ -854,6 +854,7 @@ out_device_name:
 out_minor:
        chlg_minor_free(minor);
 
+out_listrm:
        list_del_init(&obd->u.cli.cl_chg_dev_linkage);
        list_del(&entry->ced_link);