Re: ext2 file type errors

From: Jamie Lokier (lkd@tantalophile.demon.co.uk)
Date: Sat Jan 22 2000 - 08:38:49 EST


Ethan Benson wrote:
> I have observed this problem for several months, every time I run
> e2fsck on my filesystems i get the following output:
>
> /dev/hda7: Setting filetype for entry 'showq' in
> /spool/postfix/public (45244) to 6.

Ext2 file type code forgot about sockets.
Apply this patch. I've been using it for months.
(This is also reorders for the common case).

-- Jamie

diff -u linux-2.3/fs/ext2/namei.c.d_type linux-2.3/fs/ext2/namei.c
--- linux-2.3/fs/ext2/namei.c.d_type Sat Jan 8 20:18:55 2000
+++ linux-2.3/fs/ext2/namei.c Sat Jan 8 20:25:02 2000
@@ -345,18 +345,20 @@
                                 umode_t mode) {
         if (!EXT2_HAS_INCOMPAT_FEATURE(sb, EXT2_FEATURE_INCOMPAT_FILETYPE))
                 return;
- if (S_ISCHR(mode))
+ if (S_ISREG(mode))
+ de->file_type = EXT2_FT_REG_FILE;
+ else if (S_ISDIR(mode))
+ de->file_type = EXT2_FT_DIR;
+ else if (S_ISLNK(mode))
+ de->file_type = EXT2_FT_SYMLINK;
+ else if (S_ISSOCK(mode))
+ de->file_type = EXT2_FT_SOCK;
+ else if (S_ISFIFO(mode))
+ de->file_type = EXT2_FT_FIFO;
+ else if (S_ISCHR(mode))
                 de->file_type = EXT2_FT_CHRDEV;
         else if (S_ISBLK(mode))
                 de->file_type = EXT2_FT_BLKDEV;
- else if (S_ISFIFO(mode))
- de->file_type = EXT2_FT_FIFO;
- else if (S_ISLNK(mode))
- de->file_type = EXT2_FT_SYMLINK;
- else if (S_ISREG(mode))
- de->file_type = EXT2_FT_REG_FILE;
- else if (S_ISDIR(mode))
- de->file_type = EXT2_FT_DIR;
 }
 
 /*

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jan 23 2000 - 21:00:27 EST