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: <20091201165440.GA2688@joi.lan>
Date:	Tue, 1 Dec 2009 17:55:11 +0100
From:	Marcin Slusarz <marcin.slusarz@...il.com>
To:	Amerigo Wang <amwang@...hat.com>
Cc:	linux-kernel@...r.kernel.org,
	Alexander Viro <viro@...iv.linux.org.uk>,
	Jens Axboe <jens.axboe@...cle.com>,
	Nick Piggin <npiggin@...e.de>, linux-fsdevel@...r.kernel.org,
	akpm@...ux-foundation.org, Theodore Ts'o <tytso@....edu>
Subject: Re: [Patch] fs: remove a useless BUG()

On Mon, Nov 30, 2009 at 09:34:14PM -0500, Amerigo Wang wrote:
> This BUG() is suspicious, it makes its following statements
> unreachable, 
only when CONFIG_BUG=y

> and it seems to be useless, since the caller
> of this function already handles the failure properly.
because this function can return NULL in other codepath

> Remove it.
I don't know why this BUG() is there (and maybe it's not really
needed), but your rationale is wrong.

> Signed-off-by: WANG Cong <amwang@...hat.com>
> Cc: Alexander Viro <viro@...iv.linux.org.uk>
> Cc: Jens Axboe <jens.axboe@...cle.com>
> Cc: Nick Piggin <npiggin@...e.de>
> Cc: "Theodore Ts'o" <tytso@....edu>
> 
> ---
> diff --git a/fs/buffer.c b/fs/buffer.c
> index 6fa5302..ac111d7 100644
> --- a/fs/buffer.c
> +++ b/fs/buffer.c
> @@ -1041,7 +1041,6 @@ grow_dev_page(struct block_device *bdev, sector_t block,
>  	return page;
>  
>  failed:
> -	BUG();
>  	unlock_page(page);
>  	page_cache_release(page);
>  	return NULL;
> --
--
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