From: nathan Date: Tue, 28 Feb 2006 22:35:35 +0000 (+0000) Subject: Branch b1_4_mountconf X-Git-Tag: v1_8_0_110~486^4~16 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=2bd043a133db5e8b0318741c7053d538def720b6;p=fs%2Flustre-release.git Branch b1_4_mountconf b=8007 Check early for double-mount --- 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++) {