summaryrefslogtreecommitdiff
path: root/misc/mke2fs.c
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2011-04-04 15:11:52 -0400
committerTheodore Ts'o <tytso@mit.edu>2011-05-18 13:19:57 -0400
commitd568782ade9b630a6f28f24b1357fc89a6ba8286 (patch)
tree08f3329a9fcdd5e5932b14a5f96b6692f63d1be6 /misc/mke2fs.c
parent1760d167b2c0f91069a8b6e4a8fef1a5bc0f9ed1 (diff)
downloade2fsprogs-d568782ade9b630a6f28f24b1357fc89a6ba8286.tar.gz
mke2fs: don't set stripe/stride to 1 block
Block devices may set minimum or optimal IO hints equal to blocksize; in this case there is really nothing for ext4 to do with this information (i.e. search for a block-aligned allocation?) so don't set fs geometry with single-block values. Zeev also reported that with a block-sized stripe, the ext4 allocator spends time spinning in ext4_mb_scan_aligned(), oddly enough. Reported-by: Zeev Tarantov <zeev.tarantov@gmail.com> Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'misc/mke2fs.c')
-rw-r--r--misc/mke2fs.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index eace0d3a..9f28901a 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -1184,8 +1184,11 @@ static int get_device_geometry(const char *file,
if ((opt_io == 0) && (psector_size > blocksize))
opt_io = psector_size;
- fs_param->s_raid_stride = min_io / blocksize;
- fs_param->s_raid_stripe_width = opt_io / blocksize;
+ /* setting stripe/stride to blocksize is pointless */
+ if (min_io > blocksize)
+ fs_param->s_raid_stride = min_io / blocksize;
+ if (opt_io > blocksize)
+ fs_param->s_raid_stripe_width = opt_io / blocksize;
rc = blkid_topology_get_alignment_offset(tp);
out: