]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: provide correct snaps to purge_stale_snap_data()
authorYan, Zheng <zyan@redhat.com>
Tue, 16 Dec 2014 07:36:04 +0000 (15:36 +0800)
committerYan, Zheng <zyan@redhat.com>
Thu, 5 Feb 2015 14:40:37 +0000 (22:40 +0800)
if a directory inode has snaprealm, its parent directory's snapshot
set can be not equal to its snapshot set

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

index 41d3ae40c01e356923f62de8ddc0f4e02a1acfc3..a0d57072aa158bd2dfa9fd7b236f4733e5828219 100644 (file)
@@ -1712,7 +1712,7 @@ void CDir::_omap_fetched(bufferlist& hdrbl, map<string, bufferlist>& omap,
          in->xattrs.swap(inode_data.xattrs);
          in->decode_snap_blob(inode_data.snap_blob);
          in->old_inodes.swap(inode_data.old_inodes);
-         if (snaps)
+         if (snaps && !in->snaprealm)
            in->purge_stale_snap_data(*snaps);
 
          if (!undef_inode) {
@@ -2015,7 +2015,7 @@ void CDir::_encode_dentry(CDentry *dn, bufferlist& bl,
     // marker, name, inode, [symlink string]
     bl.append('I');         // inode
 
-    if (in->is_multiversion() && snaps)
+    if (in->is_multiversion() && snaps && !in->snaprealm)
       in->purge_stale_snap_data(*snaps);
 
     in->encode_bare(bl);