From: Sage Weil Date: Mon, 5 Apr 2010 17:53:17 +0000 (-0700) Subject: mds: fix snap purging during commit X-Git-Tag: v0.20~121 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2b92ddce5da06aa5d4a19905d952dd29db45f2c4;p=ceph.git mds: fix snap purging during commit Use the helper! The commit_partial is still incomplete.. we need to purge the dentry after the commit completes? --- diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc index 635b24269885..ca8d74e20c7d 100644 --- a/src/mds/CDir.cc +++ b/src/mds/CDir.cc @@ -1415,16 +1415,9 @@ void CDir::_commit_full(ObjectOperation& m, const set *snaps) if (dn->linkage.is_null()) continue; // skip negative entries - if (snaps && dn->last != CEPH_NOSNAP) { - set::const_iterator p = snaps->lower_bound(dn->first); - if (p == snaps->end() || *p > dn->last) { - dout(10) << " purging " << *dn << dendl; - if (dn->linkage.is_primary() && dn->linkage.get_inode()->is_dirty()) - dn->linkage.get_inode()->mark_clean(); - remove_dentry(dn); - continue; - } - } + if (snaps && dn->last != CEPH_NOSNAP && + try_trim_snap_dentry(dn, *snaps)) + continue; n++; @@ -1464,10 +1457,6 @@ void CDir::_commit_partial(ObjectOperation& m, const set *snaps) if (snaps && dn->last != CEPH_NOSNAP) { set::const_iterator p = snaps->lower_bound(dn->first); if (p == snaps->end() || *p > dn->last) { - dout(10) << " purging " << *dn << dendl; - if (dn->linkage.is_primary() && dn->linkage.get_inode()->is_dirty()) - dn->linkage.get_inode()->mark_clean(); - dout(10) << " rm " << dn->name << " " << *dn << dendl; finalbl.append(CEPH_OSD_TMAP_RM); dn->key().encode(finalbl);