debian/patches/18-dont-use-PAGE_SIZE.patch debian/1%1.2.5-2
authorLuk Claes <luk@debian.org>
Sun, 2 Oct 2011 20:22:45 +0000 (22:22 +0200)
committerLuk Claes <luk@debian.org>
Sun, 2 Oct 2011 20:22:45 +0000 (22:22 +0200)
debian/changelog
debian/patches/18-dont-use-PAGE_SIZE.patch [new file with mode: 0644]
debian/patches/series

index 3f88f4e..3f823a9 100644 (file)
@@ -1,3 +1,9 @@
+nfs-utils (1:1.2.5-2) unstable; urgency=low
+
+  * debian/patches/18-dont-use-PAGE_SIZE.patch
+
+ -- Luk Claes <luk@debian.org>  Sun, 02 Oct 2011 22:21:10 +0200
+
 nfs-utils (1:1.2.5-1) unstable; urgency=low
 
   * New upstream version
diff --git a/debian/patches/18-dont-use-PAGE_SIZE.patch b/debian/patches/18-dont-use-PAGE_SIZE.patch
new file mode 100644 (file)
index 0000000..a2113e6
--- /dev/null
@@ -0,0 +1,20 @@
+PAGE_SIZE is not exported by all architectures as it is not fixed: it can depend on the model of the machine. So it's better to query the system configuration for the actual page size on the machine.
+
+---
+ utils/blkmapd/device-process.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/utils/blkmapd/device-process.c b/utils/blkmapd/device-process.c
+index 27ff374..652a7a8 100644
+--- a/utils/blkmapd/device-process.c
++++ b/utils/blkmapd/device-process.c
+@@ -296,7 +296,7 @@ decode_blk_volume(uint32_t **pp, uint32_t *end, struct bl_volume *vols, int voln
+               off_t stripe_unit = vol->param.bv_stripe_unit;
+               /* Check limitations imposed by device-mapper */
+               if ((stripe_unit & (stripe_unit - 1)) != 0
+-                  || stripe_unit < (off_t) (PAGE_SIZE >> 9))
++                  || stripe_unit < (off_t) (sysconf(_SC_PAGE_SIZE) >> 9))
+                       return -EIO;
+               BLK_READBUF(p, end, 4);
+               READ32(vol->bv_vol_n);
+
index e05755b..14b84c1 100644 (file)
@@ -4,3 +4,4 @@
 11-532048-reduce-verbosity.patch
 16-mount.nfs.man-update-distinction-between-fstype.patch
 17-multiarch-kerberos-paths.patch
+18-dont-use-PAGE_SIZE.patch