[PATCH] vfs_ceph: fix disk_free_fn callback

Ira Cooper ira at samba.org
Mon Feb 16 04:57:30 MST 2015


Reviewed-By: Ira Cooper <ira at samba.org>

In the future just send the patch(es) to ira at samba.org, instead of my internal
Red Hat address, it is more likely to catch my "review this" eye, for ceph
stuff.

One more reviewer, and I'll push.

Thanks,

-Ira / ira at samba.org

On Fri, Feb 13, 2015 at 06:25:57PM +0800, Yan, Zheng wrote:
> 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 at redhat.com>
> ---
>  source3/modules/vfs_ceph.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
> index ec72312..b074e2d 100644
> --- a/source3/modules/vfs_ceph.c
> +++ b/source3/modules/vfs_ceph.c
> @@ -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;
> -- 
> 1.9.3
> 


More information about the samba-technical mailing list