]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: don't cow already cowed dentry
authorSage Weil <sage@newdream.net>
Tue, 20 Apr 2010 19:39:23 +0000 (12:39 -0700)
committerSage Weil <sage@newdream.net>
Tue, 20 Apr 2010 23:39:13 +0000 (16:39 -0700)
src/mds/MDCache.cc

index 2934b662a43b7b9f4d0d1e01285fe4b2b7bf4a13..762d1a7af3cd5203b242e879bc926717a66a2e99 100644 (file)
@@ -1312,7 +1312,8 @@ void MDCache::journal_cow_dentry(Mutation *mut, EMetaBlob *metablob, CDentry *dn
     if (follows == CEPH_NOSNAP)
       follows = in->find_snaprealm()->get_newest_snap();
 
-    if (in->get_projected_parent_dn() != dn) {
+    if (in->get_projected_parent_dn() != dn &&
+       follows+1 > dn->first) {
       snapid_t oldfirst = dn->first;
       dn->first = follows+1;
       CDentry *olddn = dn->dir->add_remote_dentry(dn->name, in->ino(),  in->d_type(),