From: Peng Xie Date: Fri, 12 Jul 2019 08:31:58 +0000 (+0800) Subject: client: nfs-ganesha with cephfs client, removing dir reports not empty X-Git-Tag: v12.2.14~12^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3ab2282457c17ed076f3d2f6aae3170ddf4fa2a3;p=ceph.git client: nfs-ganesha with cephfs client, removing dir reports not empty the problem was due to the cephfs client side wrongly filled the directory offset from its readdir_cache to nfs-ganesha as its mdcache dirent cookie Fixes: http://tracker.ceph.com/issues/40746 Signed-off-by: Peng Xie (cherry picked from commit 2cce2d4c7d5f3a274c206b4090057760f357ecb0) --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 35ea7100eae..49c15f94281 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -7851,12 +7851,12 @@ int Client::_readdir_cache_cb(dir_result_t *dirp, add_dirent_cb_t cb, void *p, fill_statx(dn->inode, caps, &stx); uint64_t next_off = dn->offset + 1; + fill_dirent(&de, dn->name.c_str(), stx.stx_mode, stx.stx_ino, next_off); ++pd; if (pd == dir->readdir_cache.end()) next_off = dir_result_t::END; Inode *in = NULL; - fill_dirent(&de, dn->name.c_str(), stx.stx_mode, stx.stx_ino, next_off); if (getref) { in = dn->inode.get(); _ll_get(in);