From: Nicholas Krause <xerofoify@gmail.com>
To: dwmw2@infradead.org
Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: [PATCH] jffs2:Fix error paths return value for the function read_unknown
Date: Wed, 8 Jul 2015 16:59:55 -0400 [thread overview]
Message-ID: <1436389195-16522-1-git-send-email-xerofoify@gmail.com> (raw)
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.
Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
---
fs/jffs2/readinode.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c
index 28e0aab..63bf879 100644
--- a/fs/jffs2/readinode.c
+++ b/fs/jffs2/readinode.c
@@ -875,7 +875,7 @@ static inline int read_unknown(struct jffs2_sb_info *c, struct jffs2_raw_node_re
je16_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_re
JFFS2_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;
--
2.1.4
next reply other threads:[~2015-07-08 21:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-08 20:59 Nicholas Krause [this message]
2015-07-08 21:20 ` [PATCH] jffs2:Fix error paths return value for the function read_unknown Richard Weinberger
2015-07-08 21:20 ` nick
2015-07-08 21:27 ` Richard Weinberger
2015-07-08 21:28 ` Richard Weinberger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1436389195-16522-1-git-send-email-xerofoify@gmail.com \
--to=xerofoify@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox