All of lore.kernel.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind@infradead.org>
To: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: david-b@pacbell.net, linux-mtd@lists.infradead.org,
	Ivan Kuten <ivan.kuten@promwad.com>,
	Vadim Yatsenko <Vadim.Yatsenko@malva.ua>
Subject: Re: Some issues with the AT91 dataflash driver...
Date: Wed, 30 May 2007 10:13:22 +0300	[thread overview]
Message-ID: <1180509202.3642.131.camel@sauron> (raw)
In-Reply-To: <20070529222744.3e7a1489@dhcp-255-175.norway.atmel.com>

On Tue, 2007-05-29 at 22:27 +0200, Haavard Skinnemoen wrote:
> On Tue, 29 May 2007 22:42:43 +0300
> Artem Bityutskiy <dedekind@infradead.org> wrote:
> 
> > Sorry for long delay. I is not quite what I asked, but anyway, may you
> > pleas apply the below patch, reproduce the problem and send me the
> > result.
> > 
> > Please, do this faster if you can because I will need to disappear for
> > about 2 weeks in a day. I will try to figure out what is going wrong,
> > thanks.
> 
> Here you go. I cut out a few bits that looked uninteresting as the
> whole log ended up at almost 150K. I can send you the whole log in
> private if you want it.
> 

Haavard,

Thanks! Could you please try the below patch - it should help.


>From f84ae9eae2d0b12cff2e0f5a490a3d732458b381 Mon Sep 17 00:00:00 2001
From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Date: Wed, 30 May 2007 12:08:14 +0300
Subject: [PATCH] JFFS2: fix readinode()

If we have already read enough bytes, no need to call read_more().

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
---
 fs/jffs2/readinode.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c
index 4884d5e..5663e8c 100644
--- a/fs/jffs2/readinode.c
+++ b/fs/jffs2/readinode.c
@@ -1044,7 +1044,8 @@ static int jffs2_get_inode_nodes(struct jffs2_sb_info *c, struct jffs2_inode_inf
 
 		case JFFS2_NODETYPE_DIRENT:
 
-			if (JFFS2_MIN_NODE_HEADER < sizeof(struct jffs2_raw_dirent)) {
+			if (JFFS2_MIN_NODE_HEADER < sizeof(struct jffs2_raw_dirent) &&
+			    len < sizeof(struct jffs2_raw_dirent)) {
 				err = read_more(c, ref, sizeof(struct jffs2_raw_dirent), &len, buf);
 				if (unlikely(err))
 					goto free_out;
@@ -1058,7 +1059,8 @@ static int jffs2_get_inode_nodes(struct jffs2_sb_info *c, struct jffs2_inode_inf
 
 		case JFFS2_NODETYPE_INODE:
 
-			if (JFFS2_MIN_NODE_HEADER < sizeof(struct jffs2_raw_inode)) {
+			if (JFFS2_MIN_NODE_HEADER < sizeof(struct jffs2_raw_inode) &&
+			    len < sizeof(struct jffs2_raw_inode)) {
 				err = read_more(c, ref, sizeof(struct jffs2_raw_inode), &len, buf);
 				if (unlikely(err))
 					goto free_out;
@@ -1071,7 +1073,8 @@ static int jffs2_get_inode_nodes(struct jffs2_sb_info *c, struct jffs2_inode_inf
 			break;
 
 		default:
-			if (JFFS2_MIN_NODE_HEADER < sizeof(struct jffs2_unknown_node)) {
+			if (JFFS2_MIN_NODE_HEADER < sizeof(struct jffs2_unknown_node) &&
+			    len < sizeof(struct jffs2_unknown_node)) {
 				err = read_more(c, ref, sizeof(struct jffs2_unknown_node), &len, buf);
 				if (unlikely(err))
 					goto free_out;
-- 
1.5.0.6

-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)

  reply	other threads:[~2007-05-30  7:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <465431DA.5030500@atmel.com>
     [not found] ` <1179992308.13101.16.camel@fuzzie.sanpeople.com>
     [not found]   ` <46558893.1020802@comcast.net>
     [not found]     ` <1180010988.13101.103.camel@fuzzie.sanpeople.com>
     [not found]       ` <012d01c79e06$66823470$3204200a@head.local>
     [not found]         ` <20070524164654.3f106ead@newbox>
     [not found]           ` <20070524181437.01550127@newbox>
2007-05-27 18:08             ` Some issues with the AT91 dataflash driver Haavard Skinnemoen
2007-05-27 19:01               ` Ivan Kuten
2007-05-27 19:12               ` Haavard Skinnemoen
2007-05-28 17:44                 ` Artem Bityutskiy
2007-05-28 18:07                   ` Ivan Kuten
2007-05-28 18:25                   ` Ivan Kuten
2007-05-29 19:42                     ` Artem Bityutskiy
2007-05-29 20:27                       ` Haavard Skinnemoen
2007-05-30  7:13                         ` Artem Bityutskiy [this message]
2007-05-30  8:38                           ` Haavard Skinnemoen
2007-05-30  8:45                             ` Artem Bityutskiy
2007-05-30 10:57                             ` Ivan Kuten
2007-05-29 16:20                 ` David Brownell

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=1180509202.3642.131.camel@sauron \
    --to=dedekind@infradead.org \
    --cc=Vadim.Yatsenko@malva.ua \
    --cc=david-b@pacbell.net \
    --cc=hskinnemoen@atmel.com \
    --cc=ivan.kuten@promwad.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.