File device-if-BLKPBSZGET-is-unavailable-enforce-512.patch of Package lvm2.1005

From 502b1a3033893e588368fdd52674121785082f4c Mon Sep 17 00:00:00 2001
From: Liuhua Wang <lwang@suse.com>
Date: Mon, 2 Nov 2015 15:01:06 +0800
Subject: [PATCH] device: if BLKPBSZGET is unavailable, enforce 512

 If there is no define for BLKPBSZGET - we have hard time how to
 decrypt physical block size - we can't use here block_size,
 since this is usually 4k while we need to use 512b.

Upstream-commit: 3c818c89467f9b54bc94d9919a127dd912d96c24
---
 lib/device/dev-io.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/device/dev-io.c b/lib/device/dev-io.c
index 3b0d32e..d15f7a8 100644
--- a/lib/device/dev-io.c
+++ b/lib/device/dev-io.c
@@ -158,7 +158,9 @@ int dev_get_block_size(struct device *dev, unsigned int *physical_block_size, un
    }
 #else
    /* if we can't get physical block size, just use logical block size instead */
-   dev->phys_block_size = dev->block_size;
+    // FIXME block_size is typically 4096b while phys_block_size is 512b
+    dev->phys_block_size = 512;// dev->block_size;
+
    log_debug("%s: physical block size can't be determined, using logical "
               "block size of %u bytes instead", name, dev->phys_block_size);
 #endif
-- 
1.8.4.5

openSUSE Build Service is sponsored by