+Thu Aug 14 10:55:21 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * message.c: Add compression for the word "Illegal"
+
+ * problem.c: Added entries for PR_2_BAD_CHAR_DEV and
+ PR_2_BAD_BLOCK_DEV
+
+Wed Aug 13 09:55:57 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * pass1.c (pass1, check_device_inode), pass2.c
+ (process_bad_inode): Use a more stringent test for a valid
+ device.
+
Sun Aug 10 18:58:02 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
* e2fsck.c (check_mount): Add stronger warning message about the
struct ext2_inode *inode);
extern errcode_t pass1_write_inode(ext2_filsys fs, ino_t ino,
struct ext2_inode *inode);
+extern int e2fsck_pass1_check_device_inode(struct ext2_inode *inode);
/* badblock.c */
extern void read_bad_blocks_file(ext2_filsys fs, const char *bad_blocks_file,
* @B bitmap
* @C conflicts with some other fs block
* @i inode
+ * @I illegal
* @D deleted
* @d directory
* @e entry
"Bbitmap",
"Cconflicts with some other fs @b",
"iinode",
+ "Iillegal",
"Ddeleted",
"ddirectory",
"eentry",
fs_fragmented = 0;
}
+/*
+ * Check to make sure a device inode is real. Returns 1 if the device
+ * checks out, 0 if not.
+ */
+int e2fsck_pass1_check_device_inode(struct ext2_inode *inode)
+{
+ int i;
+
+ for (i=4; i < EXT2_N_BLOCKS; i++)
+ if (inode->i_block[i])
+ return 0;
+ return 1;
+}
+
void pass1(ext2_filsys fs)
{
ino_t ino;
fs_directory_count++;
} else if (LINUX_S_ISREG (inode.i_mode))
fs_regular_count++;
- else if (LINUX_S_ISCHR (inode.i_mode))
+ else if (LINUX_S_ISCHR (inode.i_mode) &&
+ e2fsck_pass1_check_device_inode(&inode))
fs_chardev_count++;
- else if (LINUX_S_ISBLK (inode.i_mode))
+ else if (LINUX_S_ISBLK (inode.i_mode) &&
+ e2fsck_pass1_check_device_inode(&inode))
fs_blockdev_count++;
else if (LINUX_S_ISLNK (inode.i_mode)) {
fs_symlinks_count++;
return 1;
}
}
+
+ if (LINUX_S_ISCHR(inode.i_mode)
+ && !e2fsck_pass1_check_device_inode(&inode)) {
+ if (fix_problem(fs, PR_2_BAD_CHAR_DEV, &pctx)) {
+ deallocate_inode(fs, ino, 0);
+ return 1;
+ }
+ }
+
+ if (LINUX_S_ISBLK(inode.i_mode)
+ && !e2fsck_pass1_check_device_inode(&inode)) {
+ if (fix_problem(fs, PR_2_BAD_BLOCK_DEV, &pctx)) {
+ deallocate_inode(fs, ino, 0);
+ return 1;
+ }
+ }
+
+
if (inode.i_faddr &&
fix_problem(fs, PR_2_FADDR_ZERO, &pctx)) {
inode.i_faddr = 0;
/* Illegal block number in inode */
{ PR_1_ILLEGAL_BLOCK_NUM,
- "Illegal @b #%B (%b) in @i %i. ",
+ "@I @b #%B (%b) in @i %i. ",
PROMPT_CLEAR, PR_LATCH_BLOCK },
/* Block number overlaps fs metadata */
/* Illegal block number in bad block inode */
{ PR_1_BB_ILLEGAL_BLOCK_NUM,
- "Illegal @b #%B (%b) in bad @b @i. ",
+ "@I @b #%B (%b) in bad @b @i. ",
PROMPT_CLEAR, PR_LATCH_BBLOCK },
/* Bad block inode has illegal blocks (latch question) */
"'..' directory entry in @d @i %i is not NULL terminated\n",
PROMPT_FIX, 0 },
+ /* Illegal character device inode */
+ { PR_2_BAD_CHAR_DEV,
+ "@i %i (%Q) is an @I character device.\n",
+ PROMPT_CLEAR, 0 },
+
+ /* Illegal block device inode */
+ { PR_2_BAD_BLOCK_DEV,
+ "@i %i (%Q) is an @I @b device.\n",
+ PROMPT_CLEAR, 0 },
+
/* Pass 3 errors */
/* Root inode not allocated */
/* '..' is not NULL terminated */
#define PR_2_DOT_DOT_NULL_TERM 0x020017
+/* Illegal character device in inode */
+#define PR_2_BAD_CHAR_DEV 0x020018
+
+/* Illegal block device in inode */
+#define PR_2_BAD_BLOCK_DEV 0x020019
+
/*
* Pass 3 errors
*/
+Thu Aug 14 08:17:22 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * Makefile.in (install): Fix rm command to use $(DESTDIR)
+ appropriately.
+
Tue Jun 17 01:33:20 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
* Release of E2fsprogs 1.11
$(CHMOD) 644 $(DESTDIR)$(ulibdir)/libss.a
-$(RANLIB) $(DESTDIR)$(ulibdir)/libss.a
$(CHMOD) $(LIBMODE) $(DESTDIR)$(ulibdir)/libss.a
- $(RM) -f $(includedir)/ss/*
+ $(RM) -f $(DESTDIR)$(includedir)/ss/*
for i in $(INSTALL_HFILES) copyright.h; do \
$(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir)/ss/$$i; \
done