- /* Parse the user-supplied feature_set, if any. */
- if (feature_set && !strncasecmp(feature_set, "none", 4))
- feature_set = NULL;
- if (feature_set && e2p_edit_feature(feature_set,
- ¶m.s_feature_compat,
- ok_features)) {
- fprintf(stderr, _("Invalid filesystem option set: %s\n"),
- feature_set);
- exit(1);
+ /*
+ * If there's no blocksize specified and there is a journal
+ * device, use it to figure out the blocksize
+ */
+ if (blocksize == 0 && journal_device) {
+ ext2_filsys jfs;
+
+ retval = ext2fs_open(journal_device,
+ EXT2_FLAG_JOURNAL_DEV_OK, 0,
+ 0, unix_io_manager, &jfs);
+ if (retval) {
+ com_err(program_name, retval,
+ _("while trying to open journal device %s\n"),
+ journal_device);
+ exit(1);
+ }
+ blocksize = jfs->blocksize;
+ param.s_log_block_size =
+ int_log2(blocksize >> EXT2_MIN_BLOCK_LOG_SIZE);
+ ext2fs_close(jfs);
+ }
+
+ if (blocksize > sys_page_size) {
+ if (!force) {
+ com_err(program_name, 0,
+ _("%d-byte blocks too big for system (max %d)"),
+ blocksize, sys_page_size);
+ proceed_question();
+ }
+ fprintf(stderr, _("Warning: %d-byte blocks too big for system "
+ "(max %d), forced to continue\n"),
+ blocksize, sys_page_size);