mkfs.minix: check for misalignment
PATCH 1/1 mkfs.minix: check for misalignment
From: Davidlohr Bueso <[email protected]>
Date: Mon, 20 Jun 2011 23:10:13 -0400
Produce a warning if the device is misaligned.
Signed-off-by Davidlohr Bueso <[email protected]>
--- disk-utils/mkfs.minix.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
disk-utils/mkfs.minix.c +5 -0
@@ -653,6 +653,11 @@ int main(int argc, char ** argv) {DEV =open (device_name,O_RDWR |O_EXCL ); elseDEV =open (device_name,O_RDWR ); + +if (blkdev_is_misaligned (DEV )) +warnx (_ ("warning: %s is misaligned" ), device_name); + +if (DEV <0 )err (MKFS_ERROR ,_ ("%s: open failed" ), device_name);if (S_ISBLK (statbuf.st_mode)) {
Signature · 1 line
1.7.5.4
Karel Zak
maintainerQuoted 2 lines · Davidlohr Bueso
disk-utils/mkfs.minix.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
Applied with a small change, thanks.
disk-utils/mkfs.minix.c int main(int argc, char ** argv) { · line 658
Quoted 7 lines
disk-utils/mkfs.minix.c +3
-0@@ -653,6 +653,11 @@ int main(int argc, char ** argv) {DEV =open (device_name,O_RDWR |O_EXCL ); elseDEV =open (device_name,O_RDWR ); + +if (blkdev_is_misaligned (DEV )) +warnx (_ ("warning: %s is misaligned" ), device_name);
It makes sense for block devices only.
Karel
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com