]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: update last modification time and change attr for a snap realm node
authorVenky Shankar <vshankar@redhat.com>
Thu, 20 Oct 2022 10:05:44 +0000 (06:05 -0400)
committerVenky Shankar <vshankar@redhat.com>
Wed, 28 Feb 2024 13:42:30 +0000 (08:42 -0500)
Signed-off-by: Venky Shankar <vshankar@redhat.com>
(cherry picked from commit cdf4ae4ef23e83e58af045d686b653cd1de9eafd)

src/mds/Server.cc

index 8a07d5c85ce5405dc31f2d3df75efa2dc732327e..bba4a2891fac720d711b17f848dabe2f80eab712 100644 (file)
@@ -11089,6 +11089,8 @@ void Server::handle_client_mksnap(MDRequestRef& mdr)
     em.first->second = info;
   newsnap.seq = snapid;
   newsnap.last_created = snapid;
+  newsnap.last_modified = info.stamp;
+  newsnap.change_attr++;
 
   // journal the inode changes
   mdr->ls = mdlog->get_current_segment();
@@ -11179,7 +11181,6 @@ void Server::handle_client_rmsnap(MDRequestRef& mdr)
   }
   snapid_t snapid = diri->snaprealm->resolve_snapname(snapname, diri->ino());
   dout(10) << " snapname " << snapname << " is " << snapid << dendl;
-
   if (!(mdr->locking_state & MutationImpl::ALL_LOCKED)) {
     MutationImpl::LockOpVec lov;
     lov.add_xlock(&diri->snaplock);
@@ -11227,6 +11228,8 @@ void Server::handle_client_rmsnap(MDRequestRef& mdr)
   newnode.snaps.erase(snapid);
   newnode.seq = seq;
   newnode.last_destroyed = seq;
+  newnode.last_modified = mdr->get_op_stamp();
+  newnode.change_attr++;
 
   le->metablob.add_client_req(req->get_reqid(), req->get_oldest_client_tid());
   le->metablob.add_table_transaction(TABLE_SNAP, stid);
@@ -11259,6 +11262,8 @@ void Server::_rmsnap_finish(MDRequestRef& mdr, CInode *diri, snapid_t snapid)
 
   // yay
   mdr->in[0] = diri;
+  mdr->tracei = diri;
+  mdr->snapid = snapid;
   respond_to_request(mdr, 0);
 
   // purge snapshot data
@@ -11364,6 +11369,8 @@ void Server::handle_client_renamesnap(MDRequestRef& mdr)
   auto it = newsnap.snaps.find(snapid);
   ceph_assert(it != newsnap.snaps.end());
   it->second.name = dstname;
+  newsnap.last_modified = mdr->get_op_stamp();
+  newsnap.change_attr++;
 
   // journal the inode changes
   mdr->ls = mdlog->get_current_segment();