From: yury Date: Fri, 5 Dec 2008 12:36:54 +0000 (+0000) Subject: b=17758 X-Git-Tag: v1_9_120~14 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=bc1441ae47736ac3724f0dd17dc92f2e7e4d9d4a;p=fs%2Flustre-release.git b=17758 r=shadow,johann 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 71ea569..f568574 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -521,10 +521,13 @@ 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). " @@ -1149,7 +1152,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); }