From 2bd043a133db5e8b0318741c7053d538def720b6 Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 28 Feb 2006 22:35:35 +0000 Subject: [PATCH] Branch b1_4_mountconf b=8007 Check early for double-mount --- lustre/obdclass/obd_mount.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index 0992da8..0696c52 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -969,12 +969,6 @@ static int server_start_targets(struct super_block *sb, struct vfsmount *mnt) GOTO(out, rc); } - if (class_name2obd(lsi->lsi_ldd->ldd_svname)) { - LCONSOLE_ERROR("The target named %s is already running\n", - lsi->lsi_ldd->ldd_svname); - GOTO(out, rc = -EBUSY); - } - /* Let the target look up the mount using the target's name (we can't pass the sb or mnt through class_process_config.) */ rc = server_register_mount(lsi->lsi_ldd->ldd_svname, sb, mnt); @@ -1375,6 +1369,15 @@ static int server_fill_super(struct super_block *sb) lsi->lsi_ldd->ldd_svname, lsi->lsi_ldd->ldd_fsname, lsi->lsi_lmd->lmd_dev); + if (class_name2obd(lsi->lsi_ldd->ldd_svname)) { + LCONSOLE_ERROR("The target named %s is already running. " + "Double-mount may have compromised the disk " + "journal.\n", lsi->lsi_ldd->ldd_svname); + unlock_mntput(mnt); + lustre_put_lsi(sb); + GOTO(out, rc = -EALREADY); + } + /* append on-disk MGS nids to mount-line MGS nids */ for (i = 0; (i < lsi->lsi_ldd->ldd_mgsnid_count) && (lsi->lsi_lmd->lmd_mgsnid_count < MTI_NIDS_MAX); i++) { -- 1.8.3.1