lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b6c5339f0804151133j42f5b676t6093def2c006be2@mail.gmail.com>
Date:	Tue, 15 Apr 2008 14:33:35 -0400
From:	"Bob Copeland" <me@...copeland.com>
To:	"Miklos Szeredi" <miklos@...redi.hu>
Cc:	hch@...radead.org, linux-kernel@...r.kernel.org,
	linux-fsdevel@...r.kernel.org, akpm@...ux-foundation.org
Subject: Re: [PATCH 2/7] omfs: add inode routines

On Tue, Apr 15, 2008 at 2:03 PM, Miklos Szeredi <miklos@...redi.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ