From: Davidlohr Bueso <dave@gnu.org>
To: Karel Zak <kzak@redhat.com>
Cc: util-linux <util-linux@vger.kernel.org>
Subject: [PATCH] mkfs.minix: check for misalignment
Date: Mon, 20 Jun 2011 23:11:46 -0400 [thread overview]
Message-ID: <1308625906.3690.2.camel@offworld> (raw)
From: Davidlohr Bueso <dave@gnu.org>
Date: Mon, 20 Jun 2011 23:10:13 -0400
Produce a warning if the device is misaligned.
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
---
disk-utils/mkfs.minix.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/disk-utils/mkfs.minix.c b/disk-utils/mkfs.minix.c
index 405e241..bc7d941 100644
--- a/disk-utils/mkfs.minix.c
+++ b/disk-utils/mkfs.minix.c
@@ -653,6 +653,11 @@ int main(int argc, char ** argv) {
DEV = open(device_name,O_RDWR | O_EXCL);
else
DEV = 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)) {
--
1.7.5.4
next reply other threads:[~2011-06-21 3:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-21 3:11 Davidlohr Bueso [this message]
2011-06-27 14:23 ` [PATCH] mkfs.minix: check for misalignment Karel Zak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1308625906.3690.2.camel@offworld \
--to=dave@gnu.org \
--cc=kzak@redhat.com \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox