[Top] [All Lists]

Re: [PATCH 12/14] xfs_repair: address never-true tests in repair/bmap.c

To: Eric Sandeen <sandeen@xxxxxxxxxx>
Subject: Re: [PATCH 12/14] xfs_repair: address never-true tests in repair/bmap.c on 64 bit
From: Mark Tinguely <tinguely@xxxxxxx>
Date: Wed, 09 Apr 2014 08:55:47 -0500
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1396999504-13769-13-git-send-email-sandeen@xxxxxxxxxx>
References: <1396999504-13769-1-git-send-email-sandeen@xxxxxxxxxx> <1396999504-13769-13-git-send-email-sandeen@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120122 Thunderbird/9.0
On 04/08/14 18:25, Eric Sandeen wrote:
The test "if (new_naexts > BLKMAP_NEXTS_MAX)" is never true
on a 64-bit platform; new_naexts is an int, and BLKMAP_NEXTS_MAX
is INT_MAX.  So just wrap the whole thing in the #ifdef.

Signed-off-by: Eric Sandeen<sandeen@xxxxxxxxxx>
  repair/bmap.c |    8 ++++----
  1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/repair/bmap.c b/repair/bmap.c
index 85d66dc..b81efb9 100644
--- a/repair/bmap.c
+++ b/repair/bmap.c
@@ -47,16 +47,16 @@ blkmap_alloc(
        if (nex < 1)
                nex = 1;

+#if (BITS_PER_LONG == 32)      /* on 64-bit platformsethis is never true */
                                             platforms this ..,
        if (nex > BLKMAP_NEXTS_MAX) {
-#if (BITS_PER_LONG == 32)
        _("Number of extents requested in blkmap_alloc (%d) overflows 32 
          "If this is not a corruption, then you will need a 64 bit system\n"
          "to repair this filesystem.\n"),
                return NULL;

Looks good. The other patches look good too.

Reviewed-by: Mark Tinguely <tinguely@xxxxxxx>

<Prev in Thread] Current Thread [Next in Thread>