Re: [PATCH] ext2 file_type corruption

From: Niels Kristian Bech Jensen (nkbj@image.dk)
Date: Thu Apr 13 2000 - 00:40:53 EST


On Thu, 13 Apr 2000, Brian Gerst wrote:

> The file_type field in the directory entry was unconditionally being set
> to zero, causing fsck to complain. The patch is simple and obvious.
>
I think this patch is even more obvious (functionally the same):

diff -u --recursive --new-file linux-2.3.99-pre6-1/fs/ext2/namei.c linux/fs/ext2/namei.c
--- linux-2.3.99-pre6-1/fs/ext2/namei.c Tue Apr 11 23:58:47 2000
+++ linux/fs/ext2/namei.c Thu Apr 13 07:37:17 2000
@@ -284,13 +284,13 @@
                                 de->rec_len = cpu_to_le16(EXT2_DIR_REC_LEN(de->name_len));
                                 de = de1;
                         }
+ de->file_type = EXT2_FT_UNKNOWN;
                         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

-- 
Niels Kristian Bech Jensen -- nkbj@image.dk -- http://www.image.dk/~nkbj/

----------->> Stop software piracy --- use free software! <<-----------

- 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 : Sat Apr 15 2000 - 21:00:20 EST