ceph: skip set_dentry_offset work if directory not I_COMPLETE
authorSage Weil <sage@newdream.net>
Thu, 15 Apr 2010 21:08:49 +0000 (14:08 -0700)
committerSage Weil <sage@newdream.net>
Mon, 17 May 2010 22:25:27 +0000 (15:25 -0700)
Signed-off-by: Sage Weil <sage@newdream.net>
fs/ceph/inode.c

index 913cafd70cd0e5fae476f655ba92da07f8a22cc5..49a0935c43906ddaf528ea0f5237abb1f6d0469f 100644 (file)
@@ -861,6 +861,10 @@ static void ceph_set_dentry_offset(struct dentry *dn)
        di = ceph_dentry(dn);
 
        spin_lock(&inode->i_lock);
+       if ((ceph_inode(inode)->i_ceph_flags & CEPH_I_COMPLETE) == 0) {
+               spin_unlock(&inode->i_lock);
+               return;
+       }
        di->offset = ceph_inode(inode)->i_max_offset++;
        spin_unlock(&inode->i_lock);