num_physpages is shifted too far in lvm_snap's calc_max_buckets():
would go to 0 on a 4GB, 8GB, ... 32-bit machine.  Okay, not quite all
the 4GB goes into num_physpages, so it's rather an issue with 5GB ...

Naive patch (against 2.4.3-pre2 or 2.4.2-ac11 or 2.4.2 or 2.4.1) below,
but I won't be submitting this to Alan or Linus myself (unless you ask):
I expect you'll want to consider whether the number should go on
climbing linearly in that way above 1GB.

Hugh

--- 2.4.2-ac11/drivers/md/lvm-snap.c    Mon Jan 29 00:11:20 2001
+++ linux/drivers/md/lvm-snap.c Mon Mar  5 11:58:10 2001
@@ -489,10 +489,9 @@
 {
        unsigned long mem;
 
-       mem = num_physpages << PAGE_SHIFT;
-       mem /= 100;
-       mem *= 2;
-       mem /= sizeof(struct list_head);
+       mem = num_physpages;
+       mem /= 50 * sizeof(struct list_head);
+       mem <<= PAGE_SHIFT;
 
        return mem;
 }

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

Reply via email to