jffs2:Fix error paths return value for the function read_unknown
PATCH 1/1 jffs2:Fix error paths return value for the function read_unknown
This fixes the error paths in the function read_unknown that return a value to correctly return -EIO rather then the kernel value for successful function execution of zero to indicate to this function's callers that a failure has occurred related to I/O and needs to be handled by this function's caller.
--- fs/jffs2/readinode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/jffs2/readinode.c +2 -2
@@ -875,7 +875,7 @@ static inline int read_unknown(struct jffs2_sb_info *c, struct jffs2_raw_node_reje16_to_cpu (un->magic),je16_to_cpu (un->nodetype), je32_to_cpu(un->totlen), je32_to_cpu(un->hdr_crc));jffs2_mark_node_obsolete (c, ref); -return 0 ; +return -EIO ; } un->nodetype =cpu_to_je16 (JFFS2_NODE_ACCURATE |je16_to_cpu (un->nodetype));
@@ -904,7 +904,7 @@ static inline int read_unknown(struct jffs2_sb_info *c, struct jffs2_raw_node_reJFFS2_NOTICE ("unknown RWCOMPAT_DELETE nodetype %#04X at %#08x\n" ,je16_to_cpu (un->nodetype),ref_offset (ref));jffs2_mark_node_obsolete (c, ref); -return 0 ; +return -EIO ; }return 0 ;
Signature · 1 line
2.1.4
Quoted 5 lines · Nicholas Krause
This fixes the error paths in the function
read_unknownthat return a value to correctly return-EIOrather then the kernel value for successful function execution of zero to indicate to this function's callers that a failure has occurred related to I/O and needs to be handled by this function's caller.
Did you test this patch?
I guess not.
Signature · 2 lines
Thanks, //richard
Quoted 10 lines · Richard Weinberger
Quoted 5 lines · Nicholas Krause
This fixes the error paths in the function
read_unknownthat return a value to correctly return-EIOrather then the kernel value for successful function execution of zero to indicate to this function's callers that a failure has occurred related to I/O and needs to be handled by this function's caller.Did you test this patch?
I guess not.
No I don't have hardware why?
Nick
Richard Weinberger
maintainerAm 08.07.2015 um 23:20 schrieb nick:
Quoted 10 lines · Richard Weinberger
Quoted 7 lines · Nicholas Krause
Quoted 5 lines
This fixes the error paths in the function
read_unknownthat return a value to correctly return-EIOrather then the kernel value for successful function execution of zero to indicate to this function's callers that a failure has occurred related to I/O and needs to be handled by this function's caller.
Quoted 4 lines
Quoted 3 lines
Did you test this patch?
I guess not.No I don't have hardware why?
It is broken.
Both paths are not fatal errors and the soft error is already handled by calling jffs2_mark_node_obsolete().
Thanks,
//richard
Richard Weinberger
maintainerQuoted 1 line
Quoted 1 line · Nicholas Krause
Oh, damn. I should have stopped reading here. /ignore.
Thanks,
//richard