[lustre-devel] [PATCH 01/32] lustre: mdc: Remove entry from list before freeing

James Simmons jsimmons at infradead.org
Wed Aug 3 18:37:46 PDT 2022


From: Oleg Drokin <green at whamcloud.com>

mdc_changelog_cdev_init forgot to remove entries from list if
chardev allocation failed

Fixes: dcedf3009a71 ("lustre: changelog: support large number of MDT")
WC-bug-id: https://jira.whamcloud.com/browse/LU-15901
Lustre-commit: 441ec2296a0938dd3 ("LU-15901 mdc: Remove entry from list before freeing")
Signed-off-by: Oleg Drokin <green at whamcloud.com>
Reviewed-on: https://review.whamcloud.com/47480
Reviewed-by: Andreas Dilger <adilger at whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao at whamcloud.com>
Reviewed-by: James Simmons <jsimmons at infradead.org>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 fs/lustre/mdc/mdc_changelog.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/lustre/mdc/mdc_changelog.c b/fs/lustre/mdc/mdc_changelog.c
index d366720..36d7fdd 100644
--- a/fs/lustre/mdc/mdc_changelog.c
+++ b/fs/lustre/mdc/mdc_changelog.c
@@ -837,7 +837,7 @@ int mdc_changelog_cdev_init(struct obd_device *obd)
 
 	rc = chlg_minor_alloc(&minor);
 	if (rc)
-		goto out_unlock;
+		goto out_listrm;
 
 	device_initialize(&entry->ced_device);
 	entry->ced_device.devt = MKDEV(MAJOR(mdc_changelog_dev), minor);
@@ -866,6 +866,7 @@ int mdc_changelog_cdev_init(struct obd_device *obd)
 out_minor:
 	chlg_minor_free(minor);
 
+out_listrm:
 	list_del_init(&obd->u.cli.cl_chg_dev_linkage);
 	list_del(&entry->ced_link);
 
-- 
1.8.3.1



More information about the lustre-devel mailing list