From 1f6169c31bdb5c12e822dde60e6c08393d55e6a8 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Fri, 8 Nov 2002 12:26:37 -0500 Subject: [PATCH] fsimext2.c (set_mkfs_options): Synchronize with EVMS CVS rev 1.7 (2002/09/11): Add a hack to force mkfs won't a blocksize equal to the hardsector size if it is larger than 512 bytes. --- lib/evms/ChangeLog | 5 +++++ lib/evms/fsimext2.c | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/lib/evms/ChangeLog b/lib/evms/ChangeLog index 307163c..f4c0b32 100644 --- a/lib/evms/ChangeLog +++ b/lib/evms/ChangeLog @@ -1,5 +1,10 @@ 2002-11-08 Theodore Ts'o + * fsimext2.c (set_mkfs_options): Synchronize with EVMS CVS rev + 1.7 (2002/09/11): Add a hack to force mkfs won't a + blocksize equal to the hardsector size if it is larger + than 512 bytes. + * fs_ext2.c (fs_expand, fs_shrink): Synchronize with EVMS CVS rev 1.13 (2002/09/03). Add better error handling for child processes that die unexpectedly. diff --git a/lib/evms/fsimext2.c b/lib/evms/fsimext2.c index a0e7344..27a7f4f 100644 --- a/lib/evms/fsimext2.c +++ b/lib/evms/fsimext2.c @@ -172,6 +172,30 @@ void set_mkfs_options( option_array_t * options, /* 'quiet' option */ argv[1] = "-q"; + /* the following is a big hack to make sure that we don't use a block */ + /* size smaller than hardsector size since this does not work. */ + /* would be nice if the ext2/3 utilities (mkfs) handled this themselves */ + /* also, eventually we will implement this as a user option to manually */ + /* set block size */ + if (volume->object->geometry.bytes_per_sector != EVMS_VSECTOR_SIZE) { + switch (volume->object->geometry.bytes_per_sector) { + case 1024: + argv[2] = "-b1024"; + opt_count++; + break; + case 2048: + argv[2] = "-b2048"; + opt_count++; + break; + case 4096: + argv[2] = "-b4096"; + opt_count++; + break; + default: + /* not one we expect, just skip it */ + } + } + for ( i=0; icount; i++ ) { if ( options->option[i].is_number_based ) { -- 1.8.3.1