ceph: add new RECOVER mount_state when recovering session
[sfrench/cifs-2.6.git] / fs / ceph / super.c
index 33ba6f0aa55ce7d24bb281d2e6a2d32115fece80..9b1b7f4cfdd4b10442412e8cfb5cc4ecfb6130c6 100644 (file)
@@ -831,6 +831,13 @@ static void destroy_caches(void)
        ceph_fscache_unregister();
 }
 
+static void __ceph_umount_begin(struct ceph_fs_client *fsc)
+{
+       ceph_osdc_abort_requests(&fsc->client->osdc, -EIO);
+       ceph_mdsc_force_umount(fsc->mdsc);
+       fsc->filp_gen++; // invalidate open files
+}
+
 /*
  * ceph_umount_begin - initiate forced umount.  Tear down the
  * mount, skipping steps that may hang while waiting for server(s).
@@ -843,9 +850,7 @@ static void ceph_umount_begin(struct super_block *sb)
        if (!fsc)
                return;
        fsc->mount_state = CEPH_MOUNT_SHUTDOWN;
-       ceph_osdc_abort_requests(&fsc->client->osdc, -EIO);
-       ceph_mdsc_force_umount(fsc->mdsc);
-       fsc->filp_gen++; // invalidate open files
+       __ceph_umount_begin(fsc);
 }
 
 static const struct super_operations ceph_super_ops = {
@@ -1234,7 +1239,8 @@ int ceph_force_reconnect(struct super_block *sb)
        struct ceph_fs_client *fsc = ceph_sb_to_client(sb);
        int err = 0;
 
-       ceph_umount_begin(sb);
+       fsc->mount_state = CEPH_MOUNT_RECOVER;
+       __ceph_umount_begin(fsc);
 
        /* Make sure all page caches get invalidated.
         * see remove_session_caps_cb() */