]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
client: introduce a new flag indicating if dentries in directory are sorted
authorYan, Zheng <ukernel@gmail.com>
Tue, 9 Sep 2014 06:06:06 +0000 (14:06 +0800)
committerYan, Zheng <zyan@redhat.com>
Thu, 18 Sep 2014 07:55:58 +0000 (15:55 +0800)
commit600af25493947871c38214aa370e2544a7fea399
treed9c70014bc1957b69bcc6fe1e339dc1c9f8b7588
parent829981792a64e3a36ef0dd007b9856d99d1dcee6
client: introduce a new flag indicating if dentries in directory are sorted

When creating a file, Client::insert_dentry_inode() set the dentry's offset
based on directory's max offset. The offset does not reflect the real
postion of the dentry in directory. Later readdir reply from real postion
of the dentry in directory. Later readdir reply from MDS may change the
dentry's position/offset. This inconsistency can cause missing/duplicate
entries in readdir result if readdir is partly satisfied by dcache_readdir().

The fix is introduce a new flag indicating if dentries in directory are
sorted. We use _readdir_cache_cb() to handle readdir only when the flag is
set, clear the flag after creating/deleting/renaming file.

Fixes: #9178
Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/client/Client.cc
src/client/Client.h
src/client/Dir.h
src/client/Inode.h