Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 58196
b: refs/heads/master
c: ab012eb
h: refs/heads/master
v: v3
  • Loading branch information
Kumba authored and Ralf Baechle committed Jul 4, 2007
1 parent 79b37cc commit fefd633
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e2baf4ed168589af8224d51f0ac50e65bcdee3f6
refs/heads/master: ab012ebf9ebb5f3392e74c1666e7473b8567aeb0
23 changes: 14 additions & 9 deletions trunk/fs/jffs2/readinode.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ static void jffs2_kill_tn(struct jffs2_sb_info *c, struct jffs2_tmp_dnode_info *
* offset, and the one with the smallest length will come first in the
* ordering.
*
* Returns 0 if the node was handled (including marking it obsolete)
* Returns 0 if the node was inserted
* 1 if the node is obsolete (because we can't mark it so yet)
* < 0 an if error occurred
*/
static int jffs2_add_tn_to_tree(struct jffs2_sb_info *c,
Expand Down Expand Up @@ -571,7 +572,8 @@ static struct jffs2_raw_node_ref *jffs2_first_valid_node(struct jffs2_raw_node_r
* Helper function for jffs2_get_inode_nodes().
* It is called every time an directory entry node is found.
*
* Returns: 0 on success;
* Returns: 0 on succes;
* 1 if the node should be marked obsolete;
* negative error code on failure.
*/
static inline int read_direntry(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *ref,
Expand Down Expand Up @@ -678,7 +680,8 @@ static inline int read_direntry(struct jffs2_sb_info *c, struct jffs2_raw_node_r
* Helper function for jffs2_get_inode_nodes().
* It is called every time an inode node is found.
*
* Returns: 0 on success (possibly after marking a bad node obsolete);
* Returns: 0 on success;
* 1 if the node should be marked obsolete;
* negative error code on failure.
*/
static inline int read_dnode(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *ref,
Expand All @@ -687,7 +690,7 @@ static inline int read_dnode(struct jffs2_sb_info *c, struct jffs2_raw_node_ref
{
struct jffs2_tmp_dnode_info *tn;
uint32_t len, csize;
int ret = 0;
int ret = 1;
uint32_t crc;

/* Obsoleted. This cannot happen, surely? dwmw2 20020308 */
Expand Down Expand Up @@ -716,9 +719,8 @@ static inline int read_dnode(struct jffs2_sb_info *c, struct jffs2_raw_node_ref
/* Sanity checks */
if (unlikely(je32_to_cpu(rd->offset) > je32_to_cpu(rd->isize)) ||
unlikely(PAD(je32_to_cpu(rd->csize) + sizeof(*rd)) != PAD(je32_to_cpu(rd->totlen)))) {
JFFS2_WARNING("inode node header CRC is corrupted at %#08x\n", ref_offset(ref));
jffs2_dbg_dump_node(c, ref_offset(ref));
jffs2_mark_node_obsolete(c, ref);
JFFS2_WARNING("inode node header CRC is corrupted at %#08x\n", ref_offset(ref));
jffs2_dbg_dump_node(c, ref_offset(ref));
goto free_out;
}

Expand Down Expand Up @@ -773,7 +775,6 @@ static inline int read_dnode(struct jffs2_sb_info *c, struct jffs2_raw_node_ref
if (len >= csize && unlikely(tn->partial_crc != je32_to_cpu(rd->data_crc))) {
JFFS2_NOTICE("wrong data CRC in data node at 0x%08x: read %#08x, calculated %#08x.\n",
ref_offset(ref), tn->partial_crc, je32_to_cpu(rd->data_crc));
jffs2_mark_node_obsolete(c, ref);
goto free_out;
}

Expand Down Expand Up @@ -853,6 +854,7 @@ static inline int read_dnode(struct jffs2_sb_info *c, struct jffs2_raw_node_ref
* It is called every time an unknown node is found.
*
* Returns: 0 on success;
* 1 if the node should be marked obsolete;
* negative error code on failure.
*/
static inline int read_unknown(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *ref, struct jffs2_unknown_node *un)
Expand Down Expand Up @@ -1086,7 +1088,10 @@ static int jffs2_get_inode_nodes(struct jffs2_sb_info *c, struct jffs2_inode_inf
}

err = read_unknown(c, ref, &node->u);
if (unlikely(err))
if (err == 1) {
jffs2_mark_node_obsolete(c, ref);
break;
} else if (unlikely(err))
goto free_out;

}
Expand Down
6 changes: 3 additions & 3 deletions trunk/include/asm-mips/mach-ip32/dma-coherence.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* Copyright (C) 2006 Ralf Baechle <ralf@linux-mips.org>
*
*/
#ifndef __ASM_MACH_IP35_DMA_COHERENCE_H
#define __ASM_MACH_IP35_DMA_COHERENCE_H
#ifndef __ASM_MACH_IP32_DMA_COHERENCE_H
#define __ASM_MACH_IP32_DMA_COHERENCE_H

#include <asm/ip32/crime.h>

Expand Down Expand Up @@ -69,4 +69,4 @@ static inline int plat_device_is_coherent(struct device *dev)
return 0; /* IP32 is non-cohernet */
}

#endif /* __ASM_MACH_IP35_DMA_COHERENCE_H */
#endif /* __ASM_MACH_IP32_DMA_COHERENCE_H */

0 comments on commit fefd633

Please sign in to comment.