summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2002-11-08 12:26:37 -0500
committerTheodore Ts'o <tytso@mit.edu>2002-11-08 12:26:37 -0500
commit1f6169c31bdb5c12e822dde60e6c08393d55e6a8 (patch)
tree753d52eab543a0a1b5b2f017c6e9939938766ea6 /lib
parentd5f445c603ab54deb43192e1caede941ba0af879 (diff)
downloade2fsprogs-1f6169c31bdb5c12e822dde60e6c08393d55e6a8.tar.gz
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/evms/ChangeLog5
-rw-r--r--lib/evms/fsimext2.c24
2 files changed, 29 insertions, 0 deletions
diff --git a/lib/evms/ChangeLog b/lib/evms/ChangeLog
index 307163c3..f4c0b329 100644
--- a/lib/evms/ChangeLog
+++ b/lib/evms/ChangeLog
@@ -1,5 +1,10 @@
2002-11-08 Theodore Ts'o <tytso@mit.edu>
+ * 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 a0e7344a..27a7f4f5 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; i<options->count; i++ ) {
if ( options->option[i].is_number_based ) {