vfs_ceph: fix disk_free_fn callback
authorYan, Zheng <zyan@redhat.com>
Fri, 13 Feb 2015 10:25:57 +0000 (18:25 +0800)
committerIra Cooper <ira@samba.org>
Mon, 16 Feb 2015 17:14:02 +0000 (18:14 +0100)
Free space and available space should be in unit of block size. Besides,
we should call disk_norm() to adjust the returned values.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
Reviewed-by: Ira Cooper <ira@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): Ira Cooper <ira@samba.org>
Autobuild-Date(master): Mon Feb 16 18:14:02 CET 2015 on sn-devel-104

source3/modules/vfs_ceph.c

index ec72312ce79cd1cd15a136ddcd79c7f2c0f918f6..b074e2d2cb807d01cb966dc3c6fdbbec06f1a1ba 100644 (file)
@@ -167,8 +167,9 @@ static uint64_t cephwrap_disk_free(struct vfs_handle_struct *handle,  const char
                 * Provide all the correct values.
                 */
                *bsize = statvfs_buf.f_bsize;
-               *dfree = statvfs_buf.f_bsize * statvfs_buf.f_bavail;
-               *dsize = statvfs_buf.f_bsize * statvfs_buf.f_blocks;
+               *dfree = statvfs_buf.f_bavail;
+               *dsize = statvfs_buf.f_blocks;
+               disk_norm(small_query, bsize, dfree, dsize);
                DEBUG(10, ("[CEPH] bsize: %llu, dfree: %llu, dsize: %llu\n",
                        llu(*bsize), llu(*dfree), llu(*dsize)));
                return *dfree;