to same nid. target_handle_connect found old connect cockie and
tried to reconnect, but can't find export for this cockie.
+Severity : normal
+Bugzilla : 11756
+Frequency : rare
+Description: umount blocks forever on error
+Details : In result of wrong using obd_no_recov and obd_force flags client can
+ hand if cancel or some other requests is lost.
+
--------------------------------------------------------------------------------
2007-07-30 Cluster File Systems, Inc. <info@clusterfs.com>
(void)ptlrpc_pinger_del_import(imp);
if (obd->obd_namespace != NULL) {
- /* obd_no_recov == local only */
+ /* obd_force == local only */
ldlm_cli_cancel_unused(obd->obd_namespace, NULL,
- obd->obd_no_recov ? LDLM_FL_LOCAL_ONLY:0,
+ obd->obd_force ? LDLM_FL_LOCAL_ONLY:0,
NULL);
ldlm_namespace_free_prior(obd->obd_namespace);
to_be_freed = obd->obd_namespace;
obd->obd_namespace = NULL;
}
- /* Yeah, obd_no_recov also (mainly) means "forced shutdown". */
- if (!obd->obd_no_recov)
+ /* Yeah, obd_force means "forced shutdown". */
+ if (!obd->obd_force)
rc = ptlrpc_disconnect_import(imp, 0);
ptlrpc_invalidate_import(imp);
* canceling "open lock" and we do not call mdc_close() in this case, as
* it will not be successful, as import is already deactivated.
*/
- if (obd->obd_no_recov)
+ if (obd->obd_force)
GOTO(out, rc = 0);
OBDO_ALLOC(oa);
if (sbi->ll_mdc_exp) {
obd = class_exp2obd(sbi->ll_mdc_exp);
if (obd)
- force = obd->obd_no_recov;
+ force = obd->obd_force;
}
/* We need to set force before the lov_disconnect in
EXIT;
return;
}
- obd->obd_no_recov = 1;
+ obd->obd_force = 1;
obd_iocontrol(IOC_OSC_SET_ACTIVE, sbi->ll_mdc_exp, sizeof ioc_data,
&ioc_data, NULL);
return;
}
- obd->obd_no_recov = 1;
+ obd->obd_force = 1;
obd_iocontrol(IOC_OSC_SET_ACTIVE, sbi->ll_osc_exp, sizeof ioc_data,
&ioc_data, NULL);
mutex_down(&pinger_sem);
CDEBUG(D_HA, "adding pingable import %s->%s\n",
imp->imp_obd->obd_uuid.uuid, obd2cli_tgt(imp->imp_obd));
+ /* if we add to pinger we want recovery on this import */
+ imp->imp_obd->obd_no_recov = 0;
+
ptlrpc_update_next_ping(imp);
/* XXX sort, blah blah */
list_add_tail(&imp->imp_pinger_chain, &pinger_imports);
list_del_init(&imp->imp_pinger_chain);
CDEBUG(D_HA, "removing pingable import %s->%s\n",
imp->imp_obd->obd_uuid.uuid, obd2cli_tgt(imp->imp_obd));
+ /* if we remove from pinger we don't want recovery on this import */
+ imp->imp_obd->obd_no_recov = 1;
class_import_put(imp);
mutex_up(&pinger_sem);
RETURN(0);
stop ost2 -f || return 93
}
+start_client() {
+ echo "start client on `facet_active_host client`"
+ start client || return 99
+}
+
+stop_client() {
+ echo "stop client on `facet_active_host client`"
+ stop client || return 100
+}
+
mount_client() {
local MOUNTPATH=$1
echo "mount $FSNAME on ${MOUNTPATH}....."
}
manual_umount_client(){
+ local rc
+ local FORCE=$1
echo "manual umount lustre on ${MOUNT}...."
- do_facet client "umount -d $MOUNT"
+ do_facet client "umount -d ${FORCE} $MOUNT"
+ rc=$?
+ return $rc
}
setup() {
# mount a second time to make sure we didnt leave upgrade flag on
$TUNEFS --dryrun $TMP/$tdir/mds || error "tunefs failed"
+ load_modules
start mds $TMP/$tdir/mds "-o loop,exclude=lustre-OST0000" || return 12
cleanup_nocli
umount_client $MOUNT
cleanup_nocli
+test_33() {
+ setup
+
+ do_facet client dd if=/dev/zero of=$MOUNT/24 bs=1024k count=1
+ # Drop lock cancelation reply during umount
+ #define OBD_FAIL_LDLM_CANCEL 0x304
+ do_facet client sysctl -w lustre.fail_loc=0x80000304
+ #sysctl -w lnet.debug=-1
+ umount_client $MOUNT
+ cleanup
+}
+run_test 33 "Drop cancel during umount"
+
+test_34a() {
+ setup
+ do_facet client multiop $DIR/file O_c &
+
+ manual_umount_client
+ rc=$?
+ do_facet client killall -USR1 multiop
+ if [ $rc -eq 0 ]; then
+ error "umount not fail!"
+ fi
+ sleep 1
+ cleanup
+}
+run_test 34a "umount with opened file should be fail"
+
+
+test_34b() {
+ setup
+ touch $DIR/$tfile || return 1
+ stop_mds --force || return 2
+
+ manual_umount_client --force
+ rc=$?
+ if [ $rc -ne 0 ]; then
+ error "mtab after failed umount - rc $rc"
+ fi
+
+ cleanup
+ return 0
+}
+run_test 34b "force umount with failed mds should be normal"
+
+test_34c() {
+ setup
+ touch $DIR/$tfile || return 1
+ stop_ost --force || return 2
+
+ manual_umount_client --force
+ rc=$?
+ if [ $rc -ne 0 ]; then
+ error "mtab after failed umount - rc $rc"
+ fi
+
+ cleanup
+ return 0
+}
+run_test 34c "force umount with failed mds should be normal"
+
equals_msg "Done"
echo "$0: completed"