]> err.no Git - linux-2.6/blobdiff - fs/jffs2/fs.c
[JFFS2] Don't trust node headers before the CRC is checked.
[linux-2.6] / fs / jffs2 / fs.c
index a0f84673ce54c9b6ae7d1f22136836a9e79eb96e..7b6c24b14f856c4cab36fe16661132640107bc85 100644 (file)
@@ -37,7 +37,7 @@ static int jffs2_do_setattr (struct inode *inode, struct iattr *iattr)
        unsigned char *mdata = NULL;
        int mdatalen = 0;
        unsigned int ivalid;
-       uint32_t phys_ofs, alloclen;
+       uint32_t alloclen;
        int ret;
        D1(printk(KERN_DEBUG "jffs2_setattr(): ino #%lu\n", inode->i_ino));
        ret = inode_change_ok(inode, iattr);
@@ -79,8 +79,8 @@ static int jffs2_do_setattr (struct inode *inode, struct iattr *iattr)
                return -ENOMEM;
        }
 
-       ret = jffs2_reserve_space(c, sizeof(*ri) + mdatalen, &phys_ofs, &alloclen,
-                               ALLOC_NORMAL, JFFS2_SUMMARY_INODE_SIZE);
+       ret = jffs2_reserve_space(c, sizeof(*ri) + mdatalen, &alloclen,
+                                 ALLOC_NORMAL, JFFS2_SUMMARY_INODE_SIZE);
        if (ret) {
                jffs2_free_raw_inode(ri);
                if (S_ISLNK(inode->i_mode & S_IFMT))
@@ -131,7 +131,7 @@ static int jffs2_do_setattr (struct inode *inode, struct iattr *iattr)
        else
                ri->data_crc = cpu_to_je32(0);
 
-       new_metadata = jffs2_write_dnode(c, f, ri, mdata, mdatalen, phys_ofs, ALLOC_NORMAL);
+       new_metadata = jffs2_write_dnode(c, f, ri, mdata, mdatalen, ALLOC_NORMAL);
        if (S_ISLNK(inode->i_mode))
                kfree(mdata);
 
@@ -664,13 +664,6 @@ static int jffs2_flash_setup(struct jffs2_sb_info *c) {
                        return ret;
        }
 
-       /* add setups for other bizarre flashes here... */
-       if (jffs2_nor_ecc(c)) {
-               ret = jffs2_nor_ecc_flash_setup(c);
-               if (ret)
-                       return ret;
-       }
-
        /* and Dataflash */
        if (jffs2_dataflash(c)) {
                ret = jffs2_dataflash_setup(c);
@@ -694,11 +687,6 @@ void jffs2_flash_cleanup(struct jffs2_sb_info *c) {
                jffs2_nand_flash_cleanup(c);
        }
 
-       /* add cleanups for other bizarre flashes here... */
-       if (jffs2_nor_ecc(c)) {
-               jffs2_nor_ecc_flash_cleanup(c);
-       }
-
        /* and DataFlash */
        if (jffs2_dataflash(c)) {
                jffs2_dataflash_cleanup(c);