From: Sage Weil Date: Fri, 16 Apr 2010 19:58:02 +0000 (-0700) Subject: ceph: don't clobber i_max_offset on already complete dir X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1b7facc41b42c2ab904b2f88b64b1f8ca0ca6cb7;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git ceph: don't clobber i_max_offset on already complete dir This can screw up offsets assigned to new dentries and break dcache readdir results. Signed-off-by: Sage Weil --- diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 49a0935c4390..aa22a0bce52f 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -675,7 +675,8 @@ static int fill_inode(struct inode *inode, /* set dir completion flag? */ if (ci->i_files == 0 && ci->i_subdirs == 0 && ceph_snap(inode) == CEPH_NOSNAP && - (le32_to_cpu(info->cap.caps) & CEPH_CAP_FILE_SHARED)) { + (le32_to_cpu(info->cap.caps) & CEPH_CAP_FILE_SHARED) && + (ci->i_ceph_flags & CEPH_I_COMPLETE) == 0) { dout(" marking %p complete (empty)\n", inode); ci->i_ceph_flags |= CEPH_I_COMPLETE; ci->i_max_offset = 2;