diff options
author | Andrew Price <andy@andrewprice.me.uk> | 2008-05-01 06:55:38 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2008-05-12 03:54:56 -0400 |
commit | ad99f77778e83358c371dab7a50bde69270ed6b8 (patch) | |
tree | d01363df916a0235bbea125317697fb05a30712f /fs/gfs2 | |
parent | 091806edd458486af13ad83c9802f5b8b54d6d19 (diff) |
[GFS2] 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>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | 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 7e8f0b1d6c6e..6387523a3153 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) | |||
1495 | 1495 | ||
1496 | al->al_alloced += *n; | 1496 | al->al_alloced += *n; |
1497 | 1497 | ||
1498 | gfs2_statfs_change(sdp, 0, -*n, 0); | 1498 | gfs2_statfs_change(sdp, 0, -(s64)*n, 0); |
1499 | gfs2_quota_change(ip, *n, ip->i_inode.i_uid, ip->i_inode.i_gid); | 1499 | gfs2_quota_change(ip, *n, ip->i_inode.i_uid, ip->i_inode.i_gid); |
1500 | 1500 | ||
1501 | spin_lock(&sdp->sd_rindex_spin); | 1501 | spin_lock(&sdp->sd_rindex_spin); |