Linux-kernel mailing list archive 2000-15,: [PATCH] ext2 file_type corruption

# [PATCH] ext2 file_type corruption

Brian Gerst (bgerst@quark.vpplus.com)
Wed, 12 Apr 2000 21:34:43 -0400

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Stephen Harris: "Re: Suggested dual human/binary interface for proc/devfs"
- Previous message: Andrew Morton: "Re: What to do with 3c59x.c?"

This is a multi-part message in MIME format.
--------------D2D204B6C2EB62CD679FD17F
Content-Type: text/plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit

The file_type field in the directory entry was unconditionally being set
to zero, causing fsck to complain. The patch is simple and obvious.

    --

    						Brian Gerst
    --------------D2D204B6C2EB62CD679FD17F
    Content-Type: text/plain; charset=iso-2022-jp;
     name="ext2-filetype.diff"
    Content-Transfer-Encoding: 7bit
    Content-Disposition: inline;
     filename="ext2-filetype.diff"

    --- linux-2.3.99p6-1/fs/ext2/namei.c	Wed Apr 12 00:28:25 2000
    +++ linux/fs/ext2/namei.c	Wed Apr 12 21:20:54 2000
    @@ -284,13 +284,13 @@
     				de->rec_len = cpu_to_le16(EXT2_DIR_REC_LEN(de->name_len));
     				de = de1;
     			}
    +			de->file_type = 0;
     			if (inode) {
     				de->inode = cpu_to_le32(inode->i_ino);
     				ext2_set_de_type(dir->i_sb, de, inode->i_mode);
     			} else
     				de->inode = 0;
     			de->name_len = namelen;
    -			de->file_type = 0;
     			memcpy (de->name, name, namelen);
     			/*
     			 * XXX shouldn't update any times until successful

    --------------D2D204B6C2EB62CD679FD17F--

    -
    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/

- Next message: Stephen Harris: "Re: Suggested dual human/binary interface for proc/devfs"
- Previous message: Andrew Morton: "Re: What to do with 3c59x.c?"