提交 f2cf418c 编写于 作者: S Sage Weil

ceph: initialize sb->s_bdi, bdi_unregister after kill_anon_super

Writeback doesn't work without the bdi set, and writeback on
umount doesn't work if we unregister the bdi too early.
Signed-off-by: NSage Weil <sage@newdream.net>
上级 c89136ea
...@@ -97,6 +97,7 @@ static int ceph_syncfs(struct super_block *sb, int wait) ...@@ -97,6 +97,7 @@ static int ceph_syncfs(struct super_block *sb, int wait)
dout("sync_fs %d\n", wait); dout("sync_fs %d\n", wait);
ceph_osdc_sync(&ceph_client(sb)->osdc); ceph_osdc_sync(&ceph_client(sb)->osdc);
ceph_mdsc_sync(&ceph_client(sb)->mdsc); ceph_mdsc_sync(&ceph_client(sb)->mdsc);
dout("sync_fs %d done\n", wait);
return 0; return 0;
} }
...@@ -777,6 +778,7 @@ static int ceph_init_bdi(struct super_block *sb, struct ceph_client *client) ...@@ -777,6 +778,7 @@ static int ceph_init_bdi(struct super_block *sb, struct ceph_client *client)
err = bdi_init(&client->backing_dev_info); err = bdi_init(&client->backing_dev_info);
if (err < 0) if (err < 0)
return err; return err;
sb->s_bdi = &client->backing_dev_info;
/* set ra_pages based on rsize mount option? */ /* set ra_pages based on rsize mount option? */
if (client->mount_args.rsize >= PAGE_CACHE_SIZE) if (client->mount_args.rsize >= PAGE_CACHE_SIZE)
...@@ -861,8 +863,8 @@ static void ceph_kill_sb(struct super_block *s) ...@@ -861,8 +863,8 @@ static void ceph_kill_sb(struct super_block *s)
struct ceph_client *client = ceph_sb_to_client(s); struct ceph_client *client = ceph_sb_to_client(s);
dout("kill_sb %p\n", s); dout("kill_sb %p\n", s);
ceph_mdsc_pre_umount(&client->mdsc); ceph_mdsc_pre_umount(&client->mdsc);
bdi_unregister(&client->backing_dev_info);
kill_anon_super(s); /* will call put_super after sb is r/o */ kill_anon_super(s); /* will call put_super after sb is r/o */
bdi_unregister(&client->backing_dev_info);
bdi_destroy(&client->backing_dev_info); bdi_destroy(&client->backing_dev_info);
ceph_destroy_client(client); ceph_destroy_client(client);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册