RETURN(0);
}
+/* umount -f client means force down, don't save state */
void ll_umount_begin(struct super_block *sb)
{
struct lustre_sb_info *lsi = s2lsi(sb);
struct obd_ioctl_data ioc_data = { 0 };
ENTRY;
- /* Make the MGC not try to cancel locks */
- lsi->lsi_flags |= LSI_UMOUNT_FAILOVER;
+ /* Tell the MGC we got umount -f */
+ lsi->lsi_flags |= LSI_UMOUNT_FORCE;
CDEBUG(D_VFSTRACE, "VFS Op: superblock %p count %d active %d\n", sb,
sb->s_count, atomic_read(&sb->s_active));
RETURN(-EBUSY);
}
+ /* MGC must always stop */
obd->obd_force = 1;
- /* Without the fail, we wait for locks to be dropped, so if the
- MGS is down, we might wait for an obd timeout. With the fail,
+ /* client_disconnect_export uses the no_recov flag to decide whether it
+ should disconnect or just invalidate. (The MGC has no
+ recoverable data in any case.)
+ Without no_recov, we wait for locks to be dropped, so if the
+ MGS is down, we might wait for an obd timeout. With no-recov,
if the MGS is up, we don't tell it we're disconnecting, so
we must wait until the MGS evicts the dead client before the
client can reconnect. So it's either slow disconnect, or a
slow reconnect. This could probably be fixed on the server side
by ignoring handle mismatches in target_handle_reconnect. */
- if (lsi->lsi_flags & LSI_UMOUNT_FAILOVER) {
- obd->obd_fail = 1;
- /* client_disconnect_export uses this flag to decide whether it
- should disconnect or just invalidate. (The MGC has no
- recoverable data in any case.) */
+ if (lsi->lsi_flags & LSI_UMOUNT_FORCE) {
+ /* FIXME maybe always set this? */
obd->obd_no_recov = 1;
}
-
- /* see ll_umount_begin
- obd_iocontrol(IOC_OSC_SET_ACTIVE, sbi->ll_mdc_exp, sizeof ioc_data,
- &ioc_data, NULL);
- */
- //rc = ptlrpc_set_import_active(obd->u.cli.cl_import, 0);
+ CERROR("force:%d fail:%d no_recov:%d\n", obd->obd_force, obd->obd_fail,
+ obd->obd_no_recov);
if (obd->u.cli.cl_mgc_mgsexp)
obd_disconnect(obd->u.cli.cl_mgc_mgsexp);
if (obd && (!type || !type->typ_refcnt)) {
int err;
obd->obd_force = 1;
- /* This doesn't mean much on a server obd; could probably
- drop it */
- if (lsiflags & LSI_UMOUNT_FAILOVER)
- obd->obd_fail = 1;
+ /* obd_fail doesn't mean much on a server obd */
err = class_manual_cleanup(obd);
if (!rc)
rc = err;
s2lsi_nocast(sb) = lsi;
/* we take 1 extra ref for our setup */
atomic_set(&lsi->lsi_mounts, 1);
+
+ /* Default umount style */
+ lsi->lsi_flags = LSI_UMOUNT_FAILOVER;
RETURN(lsi);
}
ENTRY;
CDEBUG(D_MOUNT, "umount -f\n");
- /* umount = force
- umount -f = failover
+ /* umount = failover
+ umount -f = force
no third way to do non-force, non-failover */
- lsi->lsi_flags |= LSI_UMOUNT_FAILOVER;
+ lsi->lsi_flags &= ~LSI_UMOUNT_FAILOVER;
+ lsi->lsi_flags |= LSI_UMOUNT_FORCE;
EXIT;
}