[PATCH 2/2] mkswap: add alignment check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch produces the program to warn if the given device is misaligned.

Signed-off-by: Davidlohr Bueso <dave@xxxxxxx>
---
 disk-utils/mkswap.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c
index 599b9b0..33717a1 100644
--- a/disk-utils/mkswap.c
+++ b/disk-utils/mkswap.c
@@ -588,6 +588,10 @@ main(int argc, char **argv) {
 		exit(EXIT_FAILURE);
 	}
 
+	if (blkdev_is_misaligned(DEV))
+		warnx(_("warning: %s is misaligned"),
+		      device_name);
+
 	/* Want a block device. Probably not /dev/hda or /dev/hdb. */
 	if (!S_ISBLK(statbuf.st_mode))
 		check=0;
-- 
1.7.1




--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux