ceph: flush pending works before shutdown super
[linux-2.6-microblaze.git] / fs / ceph / super.c
index b33082e..a092cdb 100644 (file)
@@ -551,7 +551,7 @@ static int ceph_show_options(struct seq_file *m, struct dentry *root)
 
        if (fsopt->mds_namespace)
                seq_show_option(m, "mds_namespace", fsopt->mds_namespace);
-       if (fsopt->wsize)
+       if (fsopt->wsize != CEPH_MAX_WRITE_SIZE)
                seq_printf(m, ",wsize=%d", fsopt->wsize);
        if (fsopt->rsize != CEPH_MAX_READ_SIZE)
                seq_printf(m, ",rsize=%d", fsopt->rsize);
@@ -674,6 +674,13 @@ fail:
        return ERR_PTR(err);
 }
 
+static void flush_fs_workqueues(struct ceph_fs_client *fsc)
+{
+       flush_workqueue(fsc->wb_wq);
+       flush_workqueue(fsc->pg_inv_wq);
+       flush_workqueue(fsc->trunc_wq);
+}
+
 static void destroy_fs_client(struct ceph_fs_client *fsc)
 {
        dout("destroy_fs_client %p\n", fsc);
@@ -793,6 +800,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);
        return;
 }
@@ -1088,6 +1096,8 @@ static void ceph_kill_sb(struct super_block *s)
        dout("kill_sb %p\n", s);
 
        ceph_mdsc_pre_umount(fsc->mdsc);
+       flush_fs_workqueues(fsc);
+
        generic_shutdown_super(s);
 
        fsc->client->extra_mon_dispatch = NULL;