xfs
[Top] [All Lists]

[PATCH] xfstests: initialize "valid" bitmap in randholes.c

To: xfs-oss <xfs@xxxxxxxxxxx>
Subject: [PATCH] xfstests: initialize "valid" bitmap in randholes.c
From: Eric Sandeen <sandeen@xxxxxxxxxx>
Date: Wed, 05 Feb 2014 12:35:55 -0600
Delivered-to: xfs@xxxxxxxxxxx
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.2.0
Failures were reported in xfs/008 on s390; dchinner suggested that
perhaps the uninitialized "valid" bitmap was behaving differently on
that platform, and sure enough, this patch fixes things up.

TBH, I'm not sure why using an uninitialized bitmap worked at
all, ever, anywhere...?

Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
---

diff --git a/src/randholes.c b/src/randholes.c
index 5ad602e..ee5b6b6 100644
--- a/src/randholes.c
+++ b/src/randholes.c
@@ -437,6 +437,7 @@ main(int argc, char *argv[])
                perror("malloc");
                return 1;
        }
+       memset(valid, 0, size);
 
        /* Lots of arguments affect how we open the file */
        oflags = test ? O_RDONLY : O_RDWR|O_CREAT;

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