summaryrefslogtreecommitdiffstats
path: root/lib/blkdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/blkdev.c')
-rw-r--r--lib/blkdev.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/blkdev.c b/lib/blkdev.c
index b6f9bfd32..d889b787f 100644
--- a/lib/blkdev.c
+++ b/lib/blkdev.c
@@ -240,7 +240,11 @@ int blkdev_is_misaligned(int fd)
if (ioctl(fd, BLKALIGNOFF, &aligned) < 0)
return 0; /* probably kernel < 2.6.32 */
- return aligned;
+ /*
+ * Note that kernel returns -1 as alignement offset if no compatible
+ * sizes and alignments exist for stacked devices
+ */
+ return aligned != 0 ? 1 : 0;
#else
return 0;
#endif