summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@hq.newdream.net>2011-01-12 16:53:27 -0800
committerSage Weil <sage@newdream.net>2011-01-13 15:50:06 -0800
commit1c1266bb916e6a6b362d3be95f2cc7f3c41277a6 (patch)
tree8c70982d3a5ef6e3e810f92e0a20710f42dc4ef2
parent766fc43973b16f9becb6b7402b3e052dbb84adee (diff)
downloadblackbird-op-linux-1c1266bb916e6a6b362d3be95f2cc7f3c41277a6.tar.gz
blackbird-op-linux-1c1266bb916e6a6b362d3be95f2cc7f3c41277a6.zip
ceph: fix getattr on directory when using norbytes
The norbytes mount option was broken, and when doing getattr on a directory it return the rbytes instead of the number of entities. This commit fixes it. Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net> Signed-off-by: Sage Weil <sage@newdream.net>
-rw-r--r--fs/ceph/inode.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index e791fa34b23d..50001de66c69 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -701,10 +701,6 @@ static int fill_inode(struct inode *inode,
ci->i_ceph_flags |= CEPH_I_COMPLETE;
ci->i_max_offset = 2;
}
-
- /* it may be better to set st_size in getattr instead? */
- if (ceph_test_mount_opt(ceph_sb_to_client(inode->i_sb), RBYTES))
- inode->i_size = ci->i_rbytes;
break;
default:
pr_err("fill_inode %llx.%llx BAD mode 0%o\n",
@@ -1805,7 +1801,11 @@ int ceph_getattr(struct vfsmount *mnt, struct dentry *dentry,
else
stat->dev = 0;
if (S_ISDIR(inode->i_mode)) {
- stat->size = ci->i_rbytes;
+ if (ceph_test_mount_opt(ceph_sb_to_client(inode->i_sb),
+ RBYTES))
+ stat->size = ci->i_rbytes;
+ else
+ stat->size = ci->i_files + ci->i_subdirs;
stat->blocks = 0;
stat->blksize = 65536;
}
OpenPOWER on IntegriCloud