From 95fa64da98fcb9ab1cfbd51c93cf2ee4972a814e Mon Sep 17 00:00:00 2001 From: Davidlohr Bueso Date: Fri, 8 Apr 2011 21:20:53 -0300 Subject: [PATCH] mkswap: add alignment check This patch produces the program to warn if the given device is misaligned. [kzak@redhat.com: - call the check for block devices only] Signed-off-by: Davidlohr Bueso Signed-off-by: Karel Zak --- disk-utils/mkswap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c index 599b9b047c..a621641a09 100644 --- a/disk-utils/mkswap.c +++ b/disk-utils/mkswap.c @@ -599,6 +599,8 @@ main(int argc, char **argv) { errx(EXIT_FAILURE, _("error: " "%s is mounted; will not make swapspace."), device_name); + else if (blkdev_is_misaligned(DEV)) + warnx(_("warning: %s is misaligned"), device_name); if (check) check_blocks(); -- 2.47.3