filelock in LOCK_XSYN state does not allow Fs cap. so client can't
mark directory as complete when handling the readdir reply.
Signed-off-by: Yan, Zheng <zyan@redhat.com>
CInode *in = static_cast<CInode*>(lock->get_parent());
if (lock->get_state() == LOCK_EXCL &&
in->get_target_loner() >= 0 &&
- !as_anon) // as_anon => caller wants SYNC, not XSYN
+ !in->is_dir() && !as_anon) // as_anon => caller wants SYNC, not XSYN
file_xsyn(lock);
else
simple_sync(lock);