public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: linux-mtd@lists.infradead.org, dwmw2@infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: question about fs/jffs2/readinode.c
Date: Wed, 02 May 2012 15:07:49 +0300	[thread overview]
Message-ID: <1335960469.10293.49.camel@sauron.fi.intel.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1204280701210.1917@hadrien>

[-- Attachment #1: Type: text/plain, Size: 1085 bytes --]

On Sat, 2012-04-28 at 07:06 +0200, Julia Lawall wrote:
> The function read_direntry in fs/jffs2/readinode.c contains the following 
> code:
> 
>          err = jffs2_flash_read(c, (ref_offset(ref)) + read,
>                                 rd->nsize - already, &read, &fd->name[already]);
>  	if (unlikely(read != rd->nsize - already) && likely(!err))
>                        return -EIO;
> 
>          if (unlikely(err)) {
>                  JFFS2_ERROR("read remainder of name: error %d\n", err);
>                  jffs2_free_full_dirent(fd);
>                  return -EIO;
>          }
> 
> Is it intentional that the first if doesn't free fd?  At first I thought 
> that that might be the case, because what would be the point of having two 
> conditionals if they are going to do the same thing.  But I can't see why 
> fd should not be freed either, so maybe the two conditionals are just 
> there to give different error messages?

Hi Julia,

I think this is a bug and thes conditionals can be joined into one.

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-05-02 12:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-28  5:06 question about fs/jffs2/readinode.c Julia Lawall
2012-05-02 12:07 ` Artem Bityutskiy [this message]
2012-05-02 12:27   ` Julia Lawall

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=1335960469.10293.49.camel@sauron.fi.intel.com \
    --to=dedekind1@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=julia.lawall@lip6.fr \
    --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