+2006-05-13 Theodore Tso <tytso@mit.edu>
+
+ * badblocks.c (read_bad_blocks_file): Pass the private option -X
+ to badblocks so that e2fsck -cc will work correctly.
+
2006-05-08 Theodore Tso <tytso@mit.edu>
* pass5.c (check_block_bitmaps, check_inode_bitmaps): Add support
goto fatal;
}
} else {
- sprintf(buf, "badblocks -b %d %s%s%s %d", fs->blocksize,
+ sprintf(buf, "badblocks -b %d -X %s%s%s %d", fs->blocksize,
(ctx->options & E2F_OPT_PREEN) ? "" : "-s ",
(ctx->options & E2F_OPT_WRITECHECK) ? "-n " : "",
fs->device_name, fs->super->s_blocks_count);
+2006-05-13 Theodore Tso <tytso@mit.edu>
+
+ * mke2fs.c (test_disk): Pass the private option -X to badblocks so
+ that mke2fs -cc works again. (Addresses Debian bug:
+ #366017)
+
+ * badblocks.c (main, check_mount): Add a private option, -X, which
+ is only intended for use by mke2fs and e2fsck to signal
+ that it's OK to skip the EXT2_MF_BUSY test since mke2fs
+ and e2fsck already have the block device opened
+ exclusively (and therefore no one else does).
+
2006-05-08 Theodore Tso <tytso@mit.edu>
* mke2fs.c (write_inode_tables, setup_lazy_bg, main): Add support
#include "nls-enable.h"
const char * program_name = "badblocks";
-const char * done_string = N_("done \n");
+const char * done_string = N_("done \n");
static int v_flag = 0; /* verbose */
static int w_flag = 0; /* do r/w test: 0=no, 1=yes,
static int t_max = 0; /* allocated test patterns */
static unsigned long *t_patts = NULL; /* test patterns */
static int current_O_DIRECT = 0; /* Current status of O_DIRECT flag */
+static int exclusive_ok = 0;
#define T_INC 32
exit(1);
}
- if (mount_flags & EXT2_MF_BUSY) {
+ if ((mount_flags & EXT2_MF_BUSY) && !exclusive_ok) {
fprintf(stderr, _("%s is apparently in use by the system; "),
device_name);
if (force)
if (argc && *argv)
program_name = *argv;
- while ((c = getopt (argc, argv, "b:fi:o:svwnc:p:h:t:")) != EOF) {
+ while ((c = getopt (argc, argv, "b:fi:o:svwnc:p:h:t:X")) != EOF) {
switch (c) {
case 'b':
block_size = strtoul (optarg, &tmp, 0);
t_patts[t_flag++] = pattern;
}
break;
+ case 'X':
+ exclusive_ok++;
+ break;
default:
usage();
}
errcode_t retval;
char buf[1024];
- sprintf(buf, "badblocks -b %d %s%s%s %d", fs->blocksize,
+ sprintf(buf, "badblocks -b %d -X %s%s%s %d", fs->blocksize,
quiet ? "" : "-s ", (cflag > 1) ? "-w " : "",
fs->device_name, fs->super->s_blocks_count);
if (verbose)