summaryrefslogtreecommitdiffstats
path: root/fs/ceph/super.c
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2014-11-06 02:09:41 -0500
committerIlya Dryomov <idryomov@redhat.com>2014-12-17 12:09:51 -0500
commit97c85a828f36bbfffe9d77b977b65a5872b6cad4 (patch)
treedd432537785a075981f8e1ea5525b5f4f0006cf3 /fs/ceph/super.c
parent7cfa0313d0dc52e4da9f196f8ad5bfdf266fc1fb (diff)
ceph: introduce global empty snap context
Current snaphost code does not properly handle moving inode from one empty snap realm to another empty snap realm. After changing inode's snap realm, some dirty pages' snap context can be not equal to inode's i_head_snap. This can trigger BUG() in ceph_put_wrbuffer_cap_refs() The fix is introduce a global empty snap context for all empty snap realm. This avoids triggering the BUG() for filesystem with no snapshot. Fixes: http://tracker.ceph.com/issues/9928 Signed-off-by: Yan, Zheng <zyan@redhat.com> Reviewed-by: Ilya Dryomov <idryomov@redhat.com>
Diffstat (limited to 'fs/ceph/super.c')
-rw-r--r--fs/ceph/super.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index f6e12377335c..3b5c1e3335db 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -1028,15 +1028,20 @@ static int __init init_ceph(void)
1028 1028
1029 ceph_flock_init(); 1029 ceph_flock_init();
1030 ceph_xattr_init(); 1030 ceph_xattr_init();
1031 ret = ceph_snap_init();
1032 if (ret)
1033 goto out_xattr;
1031 ret = register_filesystem(&ceph_fs_type); 1034 ret = register_filesystem(&ceph_fs_type);
1032 if (ret) 1035 if (ret)
1033 goto out_icache; 1036 goto out_snap;
1034 1037
1035 pr_info("loaded (mds proto %d)\n", CEPH_MDSC_PROTOCOL); 1038 pr_info("loaded (mds proto %d)\n", CEPH_MDSC_PROTOCOL);
1036 1039
1037 return 0; 1040 return 0;
1038 1041
1039out_icache: 1042out_snap:
1043 ceph_snap_exit();
1044out_xattr:
1040 ceph_xattr_exit(); 1045 ceph_xattr_exit();
1041 destroy_caches(); 1046 destroy_caches();
1042out: 1047out:
@@ -1047,6 +1052,7 @@ static void __exit exit_ceph(void)
1047{ 1052{
1048 dout("exit_ceph\n"); 1053 dout("exit_ceph\n");
1049 unregister_filesystem(&ceph_fs_type); 1054 unregister_filesystem(&ceph_fs_type);
1055 ceph_snap_exit();
1050 ceph_xattr_exit(); 1056 ceph_xattr_exit();
1051 destroy_caches(); 1057 destroy_caches();
1052} 1058}