diff mbox series

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

Message ID 1659577097-19253-2-git-send-email-jsimmons@infradead.org (mailing list archive)
State New, archived
Headers show
Series lustre: Update to OpenSFS as of Aug 3 2022 | expand

Commit Message

James Simmons Aug. 4, 2022, 1:37 a.m. UTC
From: Oleg Drokin <green@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@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/47480
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/mdc/mdc_changelog.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

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