From: yury Date: Fri, 5 Dec 2008 11:06:58 +0000 (+0000) Subject: b=17758 X-Git-Tag: v1_7_150~1^209 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=bfcf3c6d619e954bcbaf7ae4b0247f6d52a8aa24;p=fs%2Flustre-release.git b=17758 r=johann,shadow - Do NOT call server_deregister_mount() here. This leads to inability cleanup cleanly and free lsi and other stuff when mgs calls server_put_mount() in error handling case. --- diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index f2f4542..d240cba 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -498,16 +498,18 @@ static int server_start_mgs(struct super_block *sb) rc = server_register_mount(LUSTRE_MGS_OBDNAME, sb, mnt); - if (!rc && - ((rc = lustre_start_simple(LUSTRE_MGS_OBDNAME, LUSTRE_MGS_NAME, - LUSTRE_MGS_OBDNAME, 0, 0)))) - server_deregister_mount(LUSTRE_MGS_OBDNAME); + if (!rc) { + rc = lustre_start_simple(LUSTRE_MGS_OBDNAME, LUSTRE_MGS_NAME, + LUSTRE_MGS_OBDNAME, 0, 0); + /* Do NOT call server_deregister_mount() here. This leads to + * inability cleanup cleanly and free lsi and other stuff when + * mgs calls server_put_mount() in error handling case. -umka */ + } if (rc) LCONSOLE_ERROR_MSG(0x15e, "Failed to start MGS '%s' (%d). Is " "the 'mgs' module loaded?\n", LUSTRE_MGS_OBDNAME, rc); - RETURN(rc); } @@ -1112,7 +1114,9 @@ static int server_start_targets(struct super_block *sb, struct vfsmount *mnt) if (rc) { CERROR("failed to start server %s: %d\n", lsi->lsi_ldd->ldd_svname, rc); - server_deregister_mount(lsi->lsi_ldd->ldd_svname); + /* Do NOT call server_deregister_mount() here. This makes it + * impossible to find mount later in cleanup time and leaves + * @lsi and othder stuff leaked. -umka */ GOTO(out_mgc, rc); }