FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 05-01-2008, 10:55 AM
Andrew Price
 
Default Fix cast from unsigned int to s64

This fixes bz 444829 where allocating a new block caused gfs2 file systems to
report 0 bytes used in df. It was caused by a broken cast from an unsigned int
in gfs2_block_alloc() to a negative s64 in gfs2_statfs_change(). This patch
casts the unsigned int to an s64 before the unary minus is applied.

Signed-off-by: Andrew Price <andy@andrewprice.me.uk>
---
fs/gfs2/rgrp.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 7e8f0b1..6387523 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -1495,7 +1495,7 @@ u64 gfs2_alloc_block(struct gfs2_inode *ip, unsigned int *n)

al->al_alloced += *n;

- gfs2_statfs_change(sdp, 0, -*n, 0);
+ gfs2_statfs_change(sdp, 0, -(s64)*n, 0);
gfs2_quota_change(ip, *n, ip->i_inode.i_uid, ip->i_inode.i_gid);

spin_lock(&sdp->sd_rindex_spin);
--
1.5.5
 
Old 05-01-2008, 12:50 PM
Steven Whitehouse
 
Default Fix cast from unsigned int to s64

Hi,

Now in the GFS2 -nme git tree. Thanks,

Steve.

On Thu, 2008-05-01 at 11:55 +0100, Andrew Price wrote:
> This fixes bz 444829 where allocating a new block caused gfs2 file systems to
> report 0 bytes used in df. It was caused by a broken cast from an unsigned int
> in gfs2_block_alloc() to a negative s64 in gfs2_statfs_change(). This patch
> casts the unsigned int to an s64 before the unary minus is applied.
>
> Signed-off-by: Andrew Price <andy@andrewprice.me.uk>
> ---
> fs/gfs2/rgrp.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
> index 7e8f0b1..6387523 100644
> --- a/fs/gfs2/rgrp.c
> +++ b/fs/gfs2/rgrp.c
> @@ -1495,7 +1495,7 @@ u64 gfs2_alloc_block(struct gfs2_inode *ip, unsigned int *n)
>
> al->al_alloced += *n;
>
> - gfs2_statfs_change(sdp, 0, -*n, 0);
> + gfs2_statfs_change(sdp, 0, -(s64)*n, 0);
> gfs2_quota_change(ip, *n, ip->i_inode.i_uid, ip->i_inode.i_gid);
>
> spin_lock(&sdp->sd_rindex_spin);
 
Old 05-20-2008, 09:12 AM
 
Default Fix cast from unsigned int to s64

From: Andrew Price <andy@andrewprice.me.uk>

This fixes bz 444829 where allocating a new block caused gfs2 file systems to
report 0 bytes used in df. It was caused by a broken cast from an unsigned int
in gfs2_block_alloc() to a negative s64 in gfs2_statfs_change(). This patch
casts the unsigned int to an s64 before the unary minus is applied.

Signed-off-by: Andrew Price <andy@andrewprice.me.uk>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 7e8f0b1..6387523 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -1495,7 +1495,7 @@ u64 gfs2_alloc_block(struct gfs2_inode *ip, unsigned int *n)

al->al_alloced += *n;

- gfs2_statfs_change(sdp, 0, -*n, 0);
+ gfs2_statfs_change(sdp, 0, -(s64)*n, 0);
gfs2_quota_change(ip, *n, ip->i_inode.i_uid, ip->i_inode.i_gid);

spin_lock(&sdp->sd_rindex_spin);
--
1.5.1.2
 

Thread Tools




All times are GMT. The time now is 12:39 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org