ext2_filsys current_fs;
quota_ctx_t current_qctx;
ext2_ino_t root, cwd;
+int no_copy_xattrs;
static int debugfs_setup_tdb(const char *device_name, char *undo_file,
io_manager *io_ptr)
{
errcode_t retval = ENOMEM;
- char *tdb_dir = NULL, *tdb_file = NULL;
- char *dev_name, *tmp_name;
+ const char *tdb_dir = NULL;
+ char *tdb_file = NULL;
+ char *dev_name, *tmp_name;
/* (re)open a specific undo file */
if (undo_file && undo_file[0] != 0) {
}
}
- if (catastrophic && (open_flags & EXT2_FLAG_RW)) {
- com_err(device, 0,
- "opening read-only because of catastrophic mode");
- open_flags &= ~EXT2_FLAG_RW;
- }
if (catastrophic)
- open_flags |= EXT2_FLAG_SKIP_MMP;
+ open_flags |= EXT2_FLAG_SKIP_MMP | EXT2_FLAG_IGNORE_SB_ERRORS;
if (undo_file) {
retval = debugfs_setup_tdb(device, undo_file, &io_ptr);
try_open_again:
retval = ext2fs_open(device, open_flags, superblock, blocksize,
io_ptr, ¤t_fs);
- if (retval && !(open_flags & EXT2_FLAG_IGNORE_CSUM_ERRORS)) {
+ if (retval && (retval == EXT2_ET_SB_CSUM_INVALID) &&
+ !(open_flags & EXT2_FLAG_IGNORE_CSUM_ERRORS)) {
open_flags |= EXT2_FLAG_IGNORE_CSUM_ERRORS;
printf("Checksum errors in superblock! Retrying...\n");
goto try_open_again;
}
if (retval) {
- com_err(device, retval, "while opening filesystem");
+ com_err(debug_prog_name, retval,
+ "while trying to open %s", device);
if (retval == EXT2_ET_BAD_MAGIC)
check_plausibility(device, CHECK_FS_EXIST, NULL);
current_fs = NULL;
goto usage;
st.st_rdev = makedev(major, minor);
- retval = do_mknod_internal(current_fs, cwd, argv[1], &st);
+ retval = do_mknod_internal(current_fs, cwd, argv[1],
+ st.st_mode, st.st_rdev);
if (retval)
com_err(argv[0], retval, 0);
}
reset_getopt();
while ((c = getopt (argc, argv, "bex")) != EOF) {
if (mode || c == '?') {
- print_usage:
com_err(argv[0], 0,
"Usage: inode_dump [-b]|[-e] <file>");
return;
case 'x':
case 'e':
if (size <= EXT2_GOOD_OLD_INODE_SIZE) {
- no_extra_space:
com_err(argv[0], 0, "No extra space in inode");
goto err;
}