]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: always create multiversion inode when cow inode
authorYan, Zheng <zyan@redhat.com>
Fri, 26 Dec 2014 07:03:19 +0000 (15:03 +0800)
committerYan, Zheng <zyan@redhat.com>
Thu, 5 Feb 2015 14:40:38 +0000 (22:40 +0800)
When moving a snapshotted regular file to stray directory, we need
to create an snaprealm for it. The snaprealm is required for building
correct snapshot context when purging file objects.

Current code normally create seperate inodes when a snapshotted file
inode is COWed. Each time the file inode is COWed, the head inode's
'first' is updated. So when deleting the file, we can't use head inode's
'first' to check if it was snapshotted.

This commit make MDCache::journal_cow_dentry always create multiversion
inode. multiversion inode's 'first' keeps constant.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/mds/MDCache.cc

index 2a9d5f0a1575086564ae21a80a92a60a67cf88cd..265997a2cedbe11b9908e323c0dac485fdcb25fe 100644 (file)
@@ -1563,7 +1563,7 @@ void MDCache::journal_cow_dentry(MutationImpl *mut, EMetaBlob *metablob,
     dnl = dn->get_projected_linkage();
   assert(!dnl->is_null());
 
-  if (dnl->is_primary() && dnl->get_inode()->is_multiversion()) {
+  if (dnl->is_primary()) {
     // multiversion inode.
     CInode *in = dnl->get_inode();