]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: don't mark snap directory complete when its dirstat is empty
authorYan, Zheng <zyan@redhat.com>
Tue, 2 Jan 2018 07:55:50 +0000 (15:55 +0800)
committerYan, Zheng <zyan@redhat.com>
Fri, 9 Feb 2018 10:42:29 +0000 (18:42 +0800)
MDS has trouble in tracking dirstat for snap inode. Snap directory
inode's dirstat can be inaccuracy.

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

index 8c25ae468fda9ad2a23a557332f3e889308522e6..2dfb5cbd491140c20975f2ca0db7a6afac122e52 100644 (file)
@@ -909,6 +909,7 @@ Inode * Client::add_update_inode(InodeStat *st, utime_t from,
 
   // setting I_COMPLETE needs to happen after adding the cap
   if (updating_inode &&
+      in->snapid == CEPH_NOSNAP &&
       in->is_dir() &&
       (st->cap.caps & CEPH_CAP_FILE_SHARED) &&
       (issued & CEPH_CAP_FILE_EXCL) == 0 &&