ChangeLog, e2fsck.h, pass1.c, pass2.c, pass3.c, problem.c, problem.h, util.c:
pass1.c (e2fsck_pass1): If the filesystem does not support imagic
inodes, if an inode has the imagic flag set, offer to clear the imagic
flag. If a valid device/fifo/socket has the immutable flag set, call
the new helper function check_immutable() to offerto clear the
immutable flag.
pass2.c (check_filetype): Use the new ext2_file_type() helper function
instead of calculating the file_type information manually.
pass3.c (e2fsck_reconnect_file): When adding a link to lost+found,
calculate the filetype information so that ext2fs_link() can use the
information if applicable. (get_lost_and_found): Create the
/lost+found directory with the correct filetype information if
applicable.
util.c (ext2_file_type), e2fsck.h: New function which returns the
directory entry file type information given the inode's mode bits.
problem.c, problem.h: Added new problem codes PR_1_SET_IMAGIC and
PR_1_SET_IMMUTABLE.
ChangeLog, mke2fs.8.in:
mke2fs.8.in: Update manual page so that the sparse_option filesystem
option is properly named.
diff --git a/e2fsck/pass2.c b/e2fsck/pass2.c
index e6a434c..826c0dc 100644
--- a/e2fsck/pass2.c
+++ b/e2fsck/pass2.c
@@ -311,16 +311,7 @@
else {
e2fsck_read_inode(ctx, dirent->inode, &inode,
"check_filetype");
- if (LINUX_S_ISCHR (inode.i_mode))
- should_be = EXT2_FT_CHRDEV;
- else if (LINUX_S_ISBLK (inode.i_mode))
- should_be = EXT2_FT_BLKDEV;
- else if (LINUX_S_ISLNK (inode.i_mode))
- should_be = EXT2_FT_SYMLINK;
- else if (LINUX_S_ISFIFO (inode.i_mode))
- should_be = EXT2_FT_FIFO;
- else if (LINUX_S_ISSOCK (inode.i_mode))
- should_be = EXT2_FT_SOCK;
+ should_be = ext2_file_type(inode.i_mode);
}
if (filetype == should_be)
return 0;