]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: remove snapshot dentry during rmsnap
authorYan, Zheng <zyan@redhat.com>
Sun, 28 Dec 2014 04:08:25 +0000 (12:08 +0800)
committerYan, Zheng <zyan@redhat.com>
Thu, 5 Feb 2015 14:40:38 +0000 (22:40 +0800)
reply of RMSNAP request has no trace, we need to invalidate the
snapshot dentry manually

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

index 02328914733789350ac5d4271cb7901562446082..938560ee05ce76788518be2a320669af55f53d03 100644 (file)
@@ -9236,12 +9236,16 @@ int Client::_rmdir(Inode *dir, const char *name, int uid, int gid)
   int res = get_or_create(dir, name, &de);
   if (res < 0)
     goto fail;
-  req->set_dentry(de);
   Inode *in;
   res = _lookup(dir, name, &in);
   if (res < 0)
     goto fail;
-  req->set_inode(in);
+  if (req->get_op() == CEPH_MDS_OP_RMDIR) {
+    req->set_dentry(de);
+    req->set_inode(in);
+  } else {
+    unlink(de, true, true);
+  }
 
   res = make_request(req, uid, gid);