tune2fs.8.in: Fix minor display bug in the nroff.
mke2fs.c (show_stats, write_inode_tables): Use the log10 function to
calculate the display of block numbers so that things look nice on an
80 character display.
mke2fs.c (usage): Add the sparse-super-flag to the usage message.
ChangeLog, e2fsck.c, pass1.c, pass2.c, problem.c, problem.h, unix.c:
unix.c (main): Move ext2fs_close() after e2fsck_free_context() since
e2fsck_free_context may reference data in ctx->fs.
e2fsck.c (e2fsck_reset_context): Make sure ctx->fs is non-NULL before
checking ctx->fs->dblist.
pass1.c (e2fsck_pass1): Use the device check subroutine on FIFO's and
Socket's, so that we catch bogus immutable inodes.
pass2.c (process_bad_inode): Process bad socket and fifo's.
problem.h, problem.c: Define new problem codes PR_2_BAD_FIFO and
PR_2_BAD_SOCKET.
+1998-10-28 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * unix.c (main): Move ext2fs_close() after e2fsck_free_context()
+ since e2fsck_free_context may reference data in ctx->fs.
+
+ * e2fsck.c (e2fsck_reset_context): Make sure ctx->fs is non-NULL
+ before checking ctx->fs->dblist.
+
+1998-10-09 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * pass1.c (e2fsck_pass1): Use the device check subroutine on
+ FIFO's and Socket's, so that we catch bogus immutable inodes.
+
+ * pass2.c (process_bad_inode): Process bad socket and fifo's.
+
+ * problem.h, problem.c: Define new problem codes PR_2_BAD_FIFO and
+ PR_2_BAD_SOCKET.
+
1998-09-02 Theodore Ts'o <tytso@rsts-11.mit.edu>
* problem.c: Add PR_3_NO_DIRINFO error code.
ext2fs_free_icount(ctx->inode_link_info);
ctx->inode_link_info = 0;
}
- if (ctx->fs->dblist) {
+ if (ctx->fs && ctx->fs->dblist) {
ext2fs_free_dblist(ctx->fs->dblist);
ctx->fs->dblist = 0;
}
/*
* Check to make sure a device inode is real. Returns 1 if the device
* checks out, 0 if not.
+ *
+ * Note: this routine is now also used to check FIFO's and Sockets,
+ * since they have the same requirement; the i_block fields should be
+ * zero.
*/
int e2fsck_pass1_check_device_inode(struct ext2_inode *inode)
{
goto next;
}
}
- else if (LINUX_S_ISFIFO (inode.i_mode))
+ else if (LINUX_S_ISFIFO (inode.i_mode) &&
+ e2fsck_pass1_check_device_inode(&inode))
ctx->fs_fifo_count++;
- else if (LINUX_S_ISSOCK (inode.i_mode))
+ else if ((LINUX_S_ISSOCK (inode.i_mode)) &&
+ e2fsck_pass1_check_device_inode(&inode))
ctx->fs_sockets_count++;
else {
if (!ctx->inode_bad_map)
&& !e2fsck_pass1_check_device_inode(&inode))
problem = PR_2_BAD_BLOCK_DEV;
+ if (LINUX_S_ISFIFO(inode.i_mode)
+ && !e2fsck_pass1_check_device_inode(&inode))
+ problem = PR_2_BAD_FIFO;
+
+ if (LINUX_S_ISSOCK(inode.i_mode)
+ && !e2fsck_pass1_check_device_inode(&inode))
+ problem = PR_2_BAD_SOCKET;
+
if (problem) {
if (fix_problem(ctx, problem, &pctx)) {
deallocate_inode(ctx, ino, 0);
"@d @e for '.' is big. ",
PROMPT_SPLIT, PR_NO_OK },
+ /* Illegal FIFO inode */
+ { PR_2_BAD_FIFO,
+ "@i %i (%Q) is an @I FIFO.\n",
+ PROMPT_CLEAR, 0 },
+
+ /* Illegal socket inode */
+ { PR_2_BAD_SOCKET,
+ "@i %i (%Q) is an @I socket.\n",
+ PROMPT_CLEAR, 0 },
+
/* Pass 3 errors */
/* Pass 3: Checking directory connectivity */
/* Directory entry for '.' is big. Split? */
#define PR_2_SPLIT_DOT 0x0200024
+/* Illegal FIFO */
+#define PR_2_BAD_FIFO 0x020025
+
+/* Illegal socket */
+#define PR_2_BAD_SOCKET 0x020026
+
/*
* Pass 3 errors
*/
show_stats(ctx);
e2fsck_write_bitmaps(ctx);
- ext2fs_close(fs);
#ifdef RESOURCE_TRACK
if (ctx->options & E2F_OPT_TIME)
#endif
e2fsck_free_context(ctx);
+ ext2fs_close(fs);
return exit_value;
}
+1998-11-13 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * tune2fs.8.in: Fix minor display bug in the nroff.
+
+ * mke2fs.c (show_stats, write_inode_tables): Use the log10
+ function to calculate the display of block numbers so that
+ things look nice on an 80 character display.
+
+1998-10-12 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * mke2fs.c (usage): Add the sparse-super-flag to the usage
+ message.
+
1998-07-09 Theodore Ts'o <tytso@rsts-11.mit.edu>
* Release of E2fsprogs 1.12
"[-m reserved-blocks-percentage] [-qvSV]\n\t"
"[-o creator-os] [-g blocks-per-group] [-L volume-label]\n\t"
"[-M last-mounted-directory] [-r fs-revision] [-R raid_opts]\n\t"
- "device [blocks-count]\n",
+ "[-s sparse-super-flag] device [blocks-count]\n",
program_name);
exit(1);
}
return l;
}
+static int log10(unsigned int arg)
+{
+ int l;
+
+ for (l=0; arg ; l++)
+ arg = arg / 10;
+ return l;
+}
+
static void proceed_question(NOARGS)
{
fflush(stdout);
return;
} else if ((MAJOR(s.st_rdev) == HD_MAJOR &&
MINOR(s.st_rdev)%64 == 0) ||
- (MAJOR(s.st_rdev) == SCSI_DISK_MAJOR &&
- MINOR(s.st_rdev)%16 == 0)) {
+ (SCSI_BLK_MAJOR(MAJOR(s.st_rdev)) &&
+ MINOR(s.st_rdev)%16 == 0)) {
printf("%s is entire device, not just one partition!\n",
device_name);
proceed_question();
blk_t blk;
int i, j, num, count;
char *buf;
+ char format[20], backup[80];
buf = malloc(fs->blocksize * STRIDE_LENGTH);
if (!buf) {
exit(1);
}
memset(buf, 0, fs->blocksize * STRIDE_LENGTH);
-
+
+ /*
+ * Figure out how many digits we need
+ */
+ i = log10(fs->group_desc_count);
+ sprintf(format, "%%%dd/%%%dld", i, i);
+ memset(backup, '\b', sizeof(backup)-1);
+ backup[sizeof(backup)-1] = 0;
+ if ((2*i)+1 < sizeof(backup))
+ backup[(2*i)+1] = 0;
+
if (!quiet)
printf("Writing inode tables: ");
for (i = 0; i < fs->group_desc_count; i++) {
if (!quiet)
- printf("%4d/%4ld", i, fs->group_desc_count);
+ printf(format, i, fs->group_desc_count);
blk = fs->group_desc[i].bg_inode_table;
num = fs->inode_blocks_per_group;
count, blk, error_message(retval));
}
if (!quiet)
- printf("\b\b\b\b\b\b\b\b\b");
+ fputs(backup, stdout);
}
free(buf);
if (!quiet)
- printf("done \n");
+ fputs("done \n", stdout);
}
static void create_root_dir(ext2_filsys fs)
struct ext2fs_sb *s = (struct ext2fs_sb *) fs->super;
char buf[80];
blk_t group_block;
- int i, col_left;
+ int i, need, col_left;
if (param.s_blocks_count != s->s_blocks_count)
printf("warning: %d blocks unused.\n\n",
group_block += s->s_blocks_per_group;
if (!ext2fs_bg_has_super(fs, i))
continue;
- if (!col_left--) {
+ need = log10(group_block) + 2;
+ if (need > col_left) {
printf("\n\t");
- col_left = 6;
+ col_left = 72;
}
+ col_left -= need;
printf("%u", group_block);
if (i != fs->group_desc_count - 1)
printf(", ");
set the user who can benefit from the reserved blocks.
.I user
can be a numerical uid or a user name.
-.IP
+.TP
.I -C mount-count
set the number of times the filesystem has been mounted.
.TP