All of lore.kernel.org
 help / color / mirror / Atom feed
From: swhiteho@redhat.com <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 2/3] [GFS2] Fix cast from unsigned int to s64
Date: Tue, 20 May 2008 10:12:43 +0100	[thread overview]
Message-ID: <12112747742961-git-send-email-swhiteho@redhat.com> (raw)
In-Reply-To: <12112747723560-git-send-email-swhiteho@redhat.com>

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



WARNING: multiple messages have this Message-ID (diff)
From: swhiteho@redhat.com
To: linux-kernel@vger.kernel.org, cluster-devel@redhat.com
Cc: Andrew Price <andy@andrewprice.me.uk>,
	Steven Whitehouse <swhiteho@redhat.com>
Subject: [PATCH 2/3] [GFS2] Fix cast from unsigned int to s64
Date: Tue, 20 May 2008 10:12:43 +0100	[thread overview]
Message-ID: <12112747742961-git-send-email-swhiteho@redhat.com> (raw)
In-Reply-To: <12112747723560-git-send-email-swhiteho@redhat.com>

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


  reply	other threads:[~2008-05-20  9:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-20  9:12 [Cluster-devel] [GFS2] Pre-pull patch posting (bug fixes) swhiteho
2008-05-20  9:12 ` swhiteho
2008-05-20  9:12 ` [Cluster-devel] [PATCH 1/3] [GFS2] filesystem consistency error from do_strip swhiteho
2008-05-20  9:12   ` swhiteho
2008-05-20  9:12   ` swhiteho [this message]
2008-05-20  9:12     ` [PATCH 2/3] [GFS2] Fix cast from unsigned int to s64 swhiteho
2008-05-20  9:12     ` [Cluster-devel] [PATCH 3/3] [GFS2] Prefer strlcpy() over snprintf() swhiteho
2008-05-20  9:12       ` swhiteho
2008-05-20 10:05 ` [Cluster-devel] [GFS2] Pull request Steven Whitehouse
2008-05-20 10:05   ` Steven Whitehouse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=12112747742961-git-send-email-swhiteho@redhat.com \
    --to=swhiteho@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.