From: Yan, Zheng Date: Fri, 26 Dec 2014 07:03:19 +0000 (+0800) Subject: mds: always create multiversion inode when cow inode X-Git-Tag: v0.93~87^2~23 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a0f51a2ec5cba8e3583c9b3f01b0d4c5decffb2e;p=ceph.git mds: always create multiversion inode when cow inode 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 --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 2a9d5f0a1575..265997a2cedb 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -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();