This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch RHEL7
in repository gfs2-utils.
commit ffb48cdeefbd3222c9c4499fd07c29672f2ae8af
Author: Andrew Price <anprice(a)redhat.com>
Date: Wed Jan 25 14:02:48 2017 +0000
mkfs.gfs2: Warn when device is misaligned
Normally one layer of the I/O stack will adjust for a non-zero
alignment_offset value and expose it to upper layers as zero. If a
misalignment is not accounted for, mkfs.gfs2 will see a non-zero
alignment_offset and should report the misalignment to the user as it
could harm performance.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/mkfs/main_mkfs.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c
index a2d2ba9..db83d1c 100644
--- a/gfs2/mkfs/main_mkfs.c
+++ b/gfs2/mkfs/main_mkfs.c
@@ -495,7 +495,11 @@ static unsigned choose_blocksize(struct mkfs_opts *opts)
printf("optimal_io_size: %lu\n", dev->optimal_io_size);
printf("physical_sector_size: %lu\n", dev->physical_sector_size);
}
-
+ if (dev->got_topol && dev->alignment_offset != 0) {
+ fprintf(stderr,
+ _("Warning: device is not properly aligned. This may harm
performance.\n"));
+ dev->physical_sector_size = dev->logical_sector_size;
+ }
if (!opts->got_bsize && dev->got_topol) {
if (dev->optimal_io_size <= getpagesize() &&
dev->optimal_io_size >= dev->minimum_io_size)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date