diff options
Diffstat (limited to 'fs/ceph/super.c')
-rw-r--r-- | fs/ceph/super.c | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/fs/ceph/super.c b/fs/ceph/super.c index b33082e6878f..95a3b3ac9b6e 100644 --- a/fs/ceph/super.c +++ b/fs/ceph/super.c | |||
@@ -45,7 +45,7 @@ static void ceph_put_super(struct super_block *s) | |||
45 | static int ceph_statfs(struct dentry *dentry, struct kstatfs *buf) | 45 | static int ceph_statfs(struct dentry *dentry, struct kstatfs *buf) |
46 | { | 46 | { |
47 | struct ceph_fs_client *fsc = ceph_inode_to_client(d_inode(dentry)); | 47 | struct ceph_fs_client *fsc = ceph_inode_to_client(d_inode(dentry)); |
48 | struct ceph_monmap *monmap = fsc->client->monc.monmap; | 48 | struct ceph_mon_client *monc = &fsc->client->monc; |
49 | struct ceph_statfs st; | 49 | struct ceph_statfs st; |
50 | u64 fsid; | 50 | u64 fsid; |
51 | int err; | 51 | int err; |
@@ -58,7 +58,7 @@ static int ceph_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
58 | } | 58 | } |
59 | 59 | ||
60 | dout("statfs\n"); | 60 | dout("statfs\n"); |
61 | err = ceph_monc_do_statfs(&fsc->client->monc, data_pool, &st); | 61 | err = ceph_monc_do_statfs(monc, data_pool, &st); |
62 | if (err < 0) | 62 | if (err < 0) |
63 | return err; | 63 | return err; |
64 | 64 | ||
@@ -94,8 +94,11 @@ static int ceph_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
94 | buf->f_namelen = NAME_MAX; | 94 | buf->f_namelen = NAME_MAX; |
95 | 95 | ||
96 | /* Must convert the fsid, for consistent values across arches */ | 96 | /* Must convert the fsid, for consistent values across arches */ |
97 | fsid = le64_to_cpu(*(__le64 *)(&monmap->fsid)) ^ | 97 | mutex_lock(&monc->mutex); |
98 | le64_to_cpu(*((__le64 *)&monmap->fsid + 1)); | 98 | fsid = le64_to_cpu(*(__le64 *)(&monc->monmap->fsid)) ^ |
99 | le64_to_cpu(*((__le64 *)&monc->monmap->fsid + 1)); | ||
100 | mutex_unlock(&monc->mutex); | ||
101 | |||
99 | buf->f_fsid.val[0] = fsid & 0xffffffff; | 102 | buf->f_fsid.val[0] = fsid & 0xffffffff; |
100 | buf->f_fsid.val[1] = fsid >> 32; | 103 | buf->f_fsid.val[1] = fsid >> 32; |
101 | 104 | ||
@@ -256,19 +259,19 @@ static int parse_fsopt_token(char *c, void *private) | |||
256 | break; | 259 | break; |
257 | /* misc */ | 260 | /* misc */ |
258 | case Opt_wsize: | 261 | case Opt_wsize: |
259 | if (intval < PAGE_SIZE || intval > CEPH_MAX_WRITE_SIZE) | 262 | if (intval < (int)PAGE_SIZE || intval > CEPH_MAX_WRITE_SIZE) |
260 | return -EINVAL; | 263 | return -EINVAL; |
261 | fsopt->wsize = ALIGN(intval, PAGE_SIZE); | 264 | fsopt->wsize = ALIGN(intval, PAGE_SIZE); |
262 | break; | 265 | break; |
263 | case Opt_rsize: | 266 | case Opt_rsize: |
264 | if (intval < PAGE_SIZE || intval > CEPH_MAX_READ_SIZE) | 267 | if (intval < (int)PAGE_SIZE || intval > CEPH_MAX_READ_SIZE) |
265 | return -EINVAL; | 268 | return -EINVAL; |
266 | fsopt->rsize = ALIGN(intval, PAGE_SIZE); | 269 | fsopt->rsize = ALIGN(intval, PAGE_SIZE); |
267 | break; | 270 | break; |
268 | case Opt_rasize: | 271 | case Opt_rasize: |
269 | if (intval < 0) | 272 | if (intval < 0) |
270 | return -EINVAL; | 273 | return -EINVAL; |
271 | fsopt->rasize = ALIGN(intval + PAGE_SIZE - 1, PAGE_SIZE); | 274 | fsopt->rasize = ALIGN(intval, PAGE_SIZE); |
272 | break; | 275 | break; |
273 | case Opt_caps_wanted_delay_min: | 276 | case Opt_caps_wanted_delay_min: |
274 | if (intval < 1) | 277 | if (intval < 1) |
@@ -286,7 +289,7 @@ static int parse_fsopt_token(char *c, void *private) | |||
286 | fsopt->max_readdir = intval; | 289 | fsopt->max_readdir = intval; |
287 | break; | 290 | break; |
288 | case Opt_readdir_max_bytes: | 291 | case Opt_readdir_max_bytes: |
289 | if (intval < PAGE_SIZE && intval != 0) | 292 | if (intval < (int)PAGE_SIZE && intval != 0) |
290 | return -EINVAL; | 293 | return -EINVAL; |
291 | fsopt->max_readdir_bytes = intval; | 294 | fsopt->max_readdir_bytes = intval; |
292 | break; | 295 | break; |
@@ -534,6 +537,8 @@ static int ceph_show_options(struct seq_file *m, struct dentry *root) | |||
534 | seq_puts(m, ",noasyncreaddir"); | 537 | seq_puts(m, ",noasyncreaddir"); |
535 | if ((fsopt->flags & CEPH_MOUNT_OPT_DCACHE) == 0) | 538 | if ((fsopt->flags & CEPH_MOUNT_OPT_DCACHE) == 0) |
536 | seq_puts(m, ",nodcache"); | 539 | seq_puts(m, ",nodcache"); |
540 | if (fsopt->flags & CEPH_MOUNT_OPT_INO32) | ||
541 | seq_puts(m, ",ino32"); | ||
537 | if (fsopt->flags & CEPH_MOUNT_OPT_FSCACHE) { | 542 | if (fsopt->flags & CEPH_MOUNT_OPT_FSCACHE) { |
538 | seq_show_option(m, "fsc", fsopt->fscache_uniq); | 543 | seq_show_option(m, "fsc", fsopt->fscache_uniq); |
539 | } | 544 | } |
@@ -551,7 +556,7 @@ static int ceph_show_options(struct seq_file *m, struct dentry *root) | |||
551 | 556 | ||
552 | if (fsopt->mds_namespace) | 557 | if (fsopt->mds_namespace) |
553 | seq_show_option(m, "mds_namespace", fsopt->mds_namespace); | 558 | seq_show_option(m, "mds_namespace", fsopt->mds_namespace); |
554 | if (fsopt->wsize) | 559 | if (fsopt->wsize != CEPH_MAX_WRITE_SIZE) |
555 | seq_printf(m, ",wsize=%d", fsopt->wsize); | 560 | seq_printf(m, ",wsize=%d", fsopt->wsize); |
556 | if (fsopt->rsize != CEPH_MAX_READ_SIZE) | 561 | if (fsopt->rsize != CEPH_MAX_READ_SIZE) |
557 | seq_printf(m, ",rsize=%d", fsopt->rsize); | 562 | seq_printf(m, ",rsize=%d", fsopt->rsize); |
@@ -616,7 +621,9 @@ static struct ceph_fs_client *create_fs_client(struct ceph_mount_options *fsopt, | |||
616 | err = PTR_ERR(fsc->client); | 621 | err = PTR_ERR(fsc->client); |
617 | goto fail; | 622 | goto fail; |
618 | } | 623 | } |
624 | |||
619 | fsc->client->extra_mon_dispatch = extra_mon_dispatch; | 625 | fsc->client->extra_mon_dispatch = extra_mon_dispatch; |
626 | fsc->client->osdc.abort_on_full = true; | ||
620 | 627 | ||
621 | if (!fsopt->mds_namespace) { | 628 | if (!fsopt->mds_namespace) { |
622 | ceph_monc_want_map(&fsc->client->monc, CEPH_SUB_MDSMAP, | 629 | ceph_monc_want_map(&fsc->client->monc, CEPH_SUB_MDSMAP, |
@@ -674,6 +681,13 @@ fail: | |||
674 | return ERR_PTR(err); | 681 | return ERR_PTR(err); |
675 | } | 682 | } |
676 | 683 | ||
684 | static void flush_fs_workqueues(struct ceph_fs_client *fsc) | ||
685 | { | ||
686 | flush_workqueue(fsc->wb_wq); | ||
687 | flush_workqueue(fsc->pg_inv_wq); | ||
688 | flush_workqueue(fsc->trunc_wq); | ||
689 | } | ||
690 | |||
677 | static void destroy_fs_client(struct ceph_fs_client *fsc) | 691 | static void destroy_fs_client(struct ceph_fs_client *fsc) |
678 | { | 692 | { |
679 | dout("destroy_fs_client %p\n", fsc); | 693 | dout("destroy_fs_client %p\n", fsc); |
@@ -793,6 +807,7 @@ static void ceph_umount_begin(struct super_block *sb) | |||
793 | if (!fsc) | 807 | if (!fsc) |
794 | return; | 808 | return; |
795 | fsc->mount_state = CEPH_MOUNT_SHUTDOWN; | 809 | fsc->mount_state = CEPH_MOUNT_SHUTDOWN; |
810 | ceph_osdc_abort_requests(&fsc->client->osdc, -EIO); | ||
796 | ceph_mdsc_force_umount(fsc->mdsc); | 811 | ceph_mdsc_force_umount(fsc->mdsc); |
797 | return; | 812 | return; |
798 | } | 813 | } |
@@ -1088,6 +1103,8 @@ static void ceph_kill_sb(struct super_block *s) | |||
1088 | dout("kill_sb %p\n", s); | 1103 | dout("kill_sb %p\n", s); |
1089 | 1104 | ||
1090 | ceph_mdsc_pre_umount(fsc->mdsc); | 1105 | ceph_mdsc_pre_umount(fsc->mdsc); |
1106 | flush_fs_workqueues(fsc); | ||
1107 | |||
1091 | generic_shutdown_super(s); | 1108 | generic_shutdown_super(s); |
1092 | 1109 | ||
1093 | fsc->client->extra_mon_dispatch = NULL; | 1110 | fsc->client->extra_mon_dispatch = NULL; |