This change totally breaks my testing complaining about /sbin/mount.lustre being on a readonly filesystem.
This reverts commit
2ade2c4e1481c4bacf49e871cbd299cfc2ccc3b3.
Change-Id: Id8292f7e6328caca540808ab42f885289229f96b
Reviewed-on: http://review.whamcloud.com/10911
Tested-by: Jenkins
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Tested-by: Oleg Drokin <oleg.drokin@intel.com>
stop mds${mds_index}
do_facet mds${mds_index} $cmd || rc=$?
stop mds${mds_index}
do_facet mds${mds_index} $cmd || rc=$?
- start mds${mds_index} $devname $MDS_MOUNT_OPTS || error "start failed"
+ start mds${mds_index} $devname $MDS_MOUNT_OPTS
df $MOUNT > /dev/null 2>&1
[ $rc -ne 0 ] && error "e2fsck should not report error upon "\
"short/long symlink MDT: rc=$rc"
df $MOUNT > /dev/null 2>&1
[ $rc -ne 0 ] && error "e2fsck should not report error upon "\
"short/long symlink MDT: rc=$rc"
stop mds${mdt_index}
do_facet mds${mdt_index} $cmd || rc=$?
stop mds${mdt_index}
do_facet mds${mdt_index} $cmd || rc=$?
- start mds${mdt_index} $devname $MDS_MOUNT_OPTS ||
- error "mount mds${mdt_index} failed"
+ start mds${mdt_index} $devname $MDS_MOUNT_OPTS
df $MOUNT > /dev/null 2>&1
[ $rc -ne 0 ] && break
done
df $MOUNT > /dev/null 2>&1
[ $rc -ne 0 ] && break
done
touch $WDIR/$tfile
stop mds${mdt_index}
touch $WDIR/$tfile
stop mds${mdt_index}
- start mds${mdt_index} $mdtdevname $MDS_MOUNT_OPTS ||
- error "mount mds${mdt_index} failed"
+ start mds${mdt_index} $mdtdevname $MDS_MOUNT_OPTS
#define OBD_FAIL_OSD_LMA_INCOMPAT 0x194
do_facet mds${mdt_index} lctl set_param fail_loc=0x194
#define OBD_FAIL_OSD_LMA_INCOMPAT 0x194
do_facet mds${mdt_index} lctl set_param fail_loc=0x194
$LCTL modules > $OGDB/ogdb-$HOSTNAME
# 'mount' doesn't look in $PATH, just sbin
$LCTL modules > $OGDB/ogdb-$HOSTNAME
# 'mount' doesn't look in $PATH, just sbin
- local mount_lustre=$LUSTRE/utils/mount.lustre
- if [ -f $mount_lustre ]; then
- local sbin_mount=/sbin/mount.lustre
- if grep -qe "$sbin_mount " /proc/mounts; then
- cmp $mount_lustre $sbin_mount || umount $sbin_mount
+ local MOUNT_LUSTRE=$LUSTRE/utils/mount.lustre
+ if [ -f $MOUNT_LUSTRE ]; then
+ if grep -qe "/sbin/mount\.lustre " /proc/mounts; then
+ cmp $MOUNT_LUSTRE /sbin/mount.lustre ||
+ umount /sbin/mount.lustre
- if ! grep -qe "$sbin_mount " /proc/mounts; then
- if [ ! -s "$sbin_mount" ]; then
- cat <<- EOF > "$sbin_mount"
- #!/bin/sh
- #STUB MARK
- echo "This $sbin_mount just a mountpoint." 1>&2
- echo "It is never supposed to be run." 1>&2
- logger -p emerg -- "using stub $sbin_mount $@"
- exit 1
- EOF
- chmod a+x $sbin_mount
- fi
- mount --bind $mount_lustre $sbin_mount
+ if ! grep -qe "/sbin/mount\.lustre " /proc/mounts; then
+ [ ! -f /sbin/mount.lustre ] && touch /sbin/mount.lustre
+ mount --bind $MOUNT_LUSTRE /sbin/mount.lustre
- local sbin_mount=/sbin/mount.lustre
- if grep -qe "$sbin_mount " /proc/mounts; then
- umount $sbin_mount || true
- [ -s $sbin_mount ] && ! grep -q "STUB MARK" $sbin_mount ||
- rm -f $sbin_mount
- fi
+ if grep -qe "/sbin/mount\.lustre" /proc/mounts; then
+ umount /sbin/mount.lustre || true
+ [ -w /sbin/mount.lustre -a ! -s /sbin/mount.lustre ] && \
+ rm -f /sbin/mount.lustre || true
+ fi
- check_mem_leak || return 254
+ check_mem_leak || return 254
- echo "modules unloaded."
- return 0
+ echo "modules unloaded."
+ return 0
cleanupall -f || error "cleanup failed"
unset I_MOUNTED
fi
cleanupall -f || error "cleanup failed"
unset I_MOUNTED
fi
+
+ if grep -qe "/sbin/mount\.lustre " /proc/mounts; then
+ umount /sbin/mount.lustre
+ fi