linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Bob Copeland" <me@bobcopeland.com>
To: "Miklos Szeredi" <miklos@szeredi.hu>
Cc: hch@infradead.org, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, akpm@linux-foundation.org
Subject: Re: [PATCH 2/7] omfs: add inode routines
Date: Tue, 15 Apr 2008 14:33:35 -0400	[thread overview]
Message-ID: <b6c5339f0804151133j42f5b676t6093def2c006be2@mail.gmail.com> (raw)
In-Reply-To: <E1JlpVW-0000Qy-JJ@pomaz-ex.szeredi.hu>

On Tue, Apr 15, 2008 at 2:03 PM, Miklos Szeredi <miklos@szeredi.hu> wrote:
> Hmm, looks like error handling needs a makeover if this is really to
>  become example code.  See comments inline.

Thanks for the review Miklos.

>  > +     mark_buffer_dirty(bh);
>  > +     if (wait) {
>  > +             sync_dirty_buffer(bh);
>  > +             if (buffer_req(bh) && !buffer_uptodate(bh))
>  > +                     ret = -EIO;
>
>  Hmm, here it sets ret, but doesn't exit.  Deliberate?

It was - if sync fails, it should still try writing the mirrors.  Plus
bh and bh2 get released subsequently.

>  > +             iget_failed(inode);
>  > +             return ERR_PTR(-EIO);
>
>  Should be:
>
>         if (!bh)
>                 goto iget_failed;

Nod.

>  > +out:
>  > +     ret = -EINVAL;
>  > +

>  > +     if (bh)
>  > +             brelse(bh);
>
>  This is weird.  This should be done by jumping to the proper label
>  between the brleses.

Hrm, brelse(NULL) is allowed so the check is suspect anyway.  I did
this in a couple of other places, so I'll fix those up too.

Thanks!

-- 
Bob Copeland %% www.bobcopeland.com

  reply	other threads:[~2008-04-15 18:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-12 22:58 [PATCH 2/7] omfs: add inode routines Bob Copeland
2008-04-13  8:05 ` Christoph Hellwig
2008-04-13  9:17 ` Alan Cox
2008-04-15 18:03 ` Miklos Szeredi
2008-04-15 18:33   ` Bob Copeland [this message]
2008-04-15 18:30 ` Marcin Slusarz
2008-04-15 23:56   ` Bob Copeland
2008-04-16 18:31     ` Marcin Slusarz
  -- strict thread matches above, loose matches on Subject: below --
2008-03-27  0:45 Bob Copeland
2008-03-27  6:13 ` Andi Kleen
2008-03-27 12:38   ` Bob Copeland
2008-03-28  3:42 ` Arnd Bergmann
2008-03-28 13:34   ` Bob Copeland
2008-03-28 20:20 ` Pavel Machek
2008-03-30  3:21   ` Bob Copeland

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=b6c5339f0804151133j42f5b676t6093def2c006be2@mail.gmail.com \
    --to=me@bobcopeland.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /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;
as well as URLs for NNTP newsgroup(s).