lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <5304496.D8N6u074t0@wuerfel>
Date:	Fri, 09 Oct 2015 14:12:36 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	Neil Brown <neilb@...e.com>
Cc:	linux-raid@...r.kernel.org, linux-kernel@...r.kernel.org,
	Goldwyn Rodrigues <rgoldwyn@...e.com>,
	linux-arm-kernel@...ts.infradead.org
Subject: [PATCH] md: fix 32-bit build warning

On 32-bit architectures, the md code produces this warning when CONFIG_LDAF
is set:

drivers/md/md.c: In function 'check_sb_changes':
drivers/md/md.c:8990:10: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'sector_t {aka long long unsigned int}' [-Wformat=]
   pr_info("%s:%d recovery_cp changed from %lu to %lu\n", __func__,

The code was only recently introduced, and uses the wrong format string
for sector_t. As a workaround, this patch adds an explicit cast to 'u64'
so we can use the %llu format string on all architectures.

Signed-off-by: Arnd Bergmann <arnd@...db.de>
Fixes: e0212320066e ("md-cluster: Improve md_reload_sb to be less error prone")
Cc: Goldwyn Rodrigues <rgoldwyn@...e.com>
---

I also noticed that some commmits in md/for-next including the one causing
the problem lack a Signed-off-by line. It might make sense to just fold this
patch and add the lines at the same time.

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 7fff1e6884d6..e13f72a3b561 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -8987,9 +8987,9 @@ static void check_sb_changes(struct mddev *mddev, struct md_rdev *rdev)
 
 	/* recovery_cp changed */
 	if (le64_to_cpu(sb->resync_offset) != mddev->recovery_cp) {
-		pr_info("%s:%d recovery_cp changed from %lu to %lu\n", __func__,
-				__LINE__, mddev->recovery_cp,
-				(unsigned long) le64_to_cpu(sb->resync_offset));
+		pr_info("%s:%d recovery_cp changed from %llu to %llu\n", __func__,
+				__LINE__, (u64)mddev->recovery_cp,
+				(u64) le64_to_cpu(sb->resync_offset));
 		mddev->recovery_cp = le64_to_cpu(sb->resync_offset);
 	}
 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ