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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 23 Jul 2008 17:16:02 -0400 (EDT)
From:	Mikulas Patocka <mpatocka@...hat.com>
To:	Alasdair G Kergon <agk@...hat.com>
cc:	Thomas Meyer <thomas@...3r.de>,
	Linux Kernel <linux-kernel@...r.kernel.org>,
	Adrian Bunk <bunk@...nel.org>, linux-next@...r.kernel.org
Subject: [PATCHES] Re: next-20080723: build fails for dm-snapshot.ko

Hi

Here is the patch for the problem.

Mikulas

---

Use sector_div to properly handle 64-bit modulo on 32-bit machines.

Signed-off-by: Mikulas Patocka <mpatocka@...hat.com>

---
 drivers/md/dm-exception-store.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: linux-2.6.26-fast/drivers/md/dm-exception-store.c
===================================================================
--- linux-2.6.26-fast.orig/drivers/md/dm-exception-store.c	2008-07-23 21:21:50.000000000 +0200
+++ linux-2.6.26-fast/drivers/md/dm-exception-store.c	2008-07-23 22:34:54.000000000 +0200
@@ -520,6 +520,7 @@ static int persistent_prepare(struct exc
 {
 	struct pstore *ps = get_info(store);
 	uint32_t stride;
+	chunk_t next_free;
 	sector_t size = get_dev_size(store->snap->cow->bdev);
 
 	/* Is there enough room ? */
@@ -533,7 +534,8 @@ static int persistent_prepare(struct exc
 	 * into account the location of the metadata chunks.
 	 */
 	stride = (ps->exceptions_per_area + 1);
-	if ((++ps->next_free % stride) == 1)
+	next_free = ++ps->next_free;
+	if (sector_div(next_free, stride) == 1)
 		ps->next_free++;
 
 	atomic_inc(&ps->pending_count);
--
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