* [Cluster-devel] [PATCH][GFS2] Fix cast from unsigned int to s64
@ 2008-05-01 10:55 Andrew Price
2008-05-01 12:50 ` Steven Whitehouse
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Price @ 2008-05-01 10:55 UTC (permalink / raw)
To: cluster-devel.redhat.com
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Cluster-devel] [PATCH][GFS2] Fix cast from unsigned int to s64
2008-05-01 10:55 [Cluster-devel] [PATCH][GFS2] Fix cast from unsigned int to s64 Andrew Price
@ 2008-05-01 12:50 ` Steven Whitehouse
0 siblings, 0 replies; 2+ messages in thread
From: Steven Whitehouse @ 2008-05-01 12:50 UTC (permalink / raw)
To: cluster-devel.redhat.com
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);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-05-01 12:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-01 10:55 [Cluster-devel] [PATCH][GFS2] Fix cast from unsigned int to s64 Andrew Price
2008-05-01 12:50 ` Steven Whitehouse
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.