summaryrefslogtreecommitdiffstats
path: root/disk-utils/mkswap.c
diff options
context:
space:
mode:
authorDavidlohr Bueso2011-04-09 02:20:53 +0200
committerKarel Zak2011-04-12 13:13:28 +0200
commit95fa64da98fcb9ab1cfbd51c93cf2ee4972a814e (patch)
tree65494dafe0e54cd2e3d4df7417c65ca6b7321406 /disk-utils/mkswap.c
parentblkdev: add blkdev_is_misaligned() (diff)
downloadkernel-qcow2-util-linux-95fa64da98fcb9ab1cfbd51c93cf2ee4972a814e.tar.gz
kernel-qcow2-util-linux-95fa64da98fcb9ab1cfbd51c93cf2ee4972a814e.tar.xz
kernel-qcow2-util-linux-95fa64da98fcb9ab1cfbd51c93cf2ee4972a814e.zip
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 <dave@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils/mkswap.c')
-rw-r--r--disk-utils/mkswap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c
index 599b9b047..a621641a0 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();