ceph: initialize i_size/i_rbytes on snapdir
authorSage Weil <sage@newdream.net>
Wed, 11 Nov 2009 23:22:37 +0000 (15:22 -0800)
committerSage Weil <sage@newdream.net>
Wed, 11 Nov 2009 23:50:28 +0000 (15:50 -0800)
Signed-off-by: Sage Weil <sage@newdream.net>
fs/ceph/inode.c

index 036873c42a78c4904a5a54d9c3fcd8b67822776e..074ee42bd34442ab1dbb9b2ed5f8e6bf4207d4bd 100644 (file)
@@ -62,6 +62,7 @@ struct inode *ceph_get_snapdir(struct inode *parent)
                .snap = CEPH_SNAPDIR,
        };
        struct inode *inode = ceph_get_inode(parent->i_sb, vino);
+       struct ceph_inode_info *ci = ceph_inode(inode);
 
        BUG_ON(!S_ISDIR(parent->i_mode));
        if (IS_ERR(inode))
@@ -71,7 +72,8 @@ struct inode *ceph_get_snapdir(struct inode *parent)
        inode->i_gid = parent->i_gid;
        inode->i_op = &ceph_dir_iops;
        inode->i_fop = &ceph_dir_fops;
-       ceph_inode(inode)->i_snap_caps = CEPH_CAP_PIN; /* so we can open */
+       ci->i_snap_caps = CEPH_CAP_PIN; /* so we can open */
+       ci->i_rbytes = 0;
        return inode;
 }