From: Davidlohr Bueso Date: Sat, 9 Apr 2011 00:20:53 +0000 (-0300) Subject: mkswap: add alignment check X-Git-Tag: v2.20-rc1~358 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=95fa64da98fcb9ab1cfbd51c93cf2ee4972a814e;p=thirdparty%2Futil-linux.git 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 --- 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();