From 592c10154f9928d6f44c18311f7edb4f4d7ff6de Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Tue, 22 Aug 2017 10:01:30 -0500 Subject: [PATCH] xfs_db: bit fuzzing should read the right bit when flipping The middle and last bit flip fuzz verbs need to read the same bit that they're trying to set. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen Signed-off-by: Eric Sandeen --- db/fuzz.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/fuzz.c b/db/fuzz.c index 53cedbc69..d0d78a943 100644 --- a/db/fuzz.c +++ b/db/fuzz.c @@ -226,7 +226,7 @@ fuzz_lastbit( int nbits) { setbit_l((char *)buf, bitoff + nbits - 1, - !getbit_l((char *)buf, bitoff)); + !getbit_l((char *)buf, bitoff + nbits - 1)); return true; } @@ -238,7 +238,7 @@ fuzz_middlebit( int nbits) { setbit_l((char *)buf, bitoff + nbits / 2, - !getbit_l((char *)buf, bitoff)); + !getbit_l((char *)buf, bitoff + nbits / 2)); return true; } -- 2.47.2