[pnfs] [PATCH 1/1] Replaced BUG() with BUG_ON()

Benny Halevy bhalevy at panasas.com
Wed May 2 12:35:28 EDT 2007


iyer at netapp.com wrote:
> From: Rahul Iyer <iyer at netapp.com>
> 
> Replaced instances of
> 
> if (....)
> 	BUG();
> 
> with
> 
> BUG_on(...);
> 
> Signed-off-by: Rahul Iyer <iyer at netapp.com>
> ---
>  fs/nfs/nfs4proc.c |   31 +++++++++++++------------------
>  1 files changed, 13 insertions(+), 18 deletions(-)
> 
> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
> index b4ce093..89702cf 100644
> --- a/fs/nfs/nfs4proc.c
> +++ b/fs/nfs/nfs4proc.c
> @@ -222,10 +222,9 @@ static int nfs41_proc_sequence_done(struct nfs4_session *session, struct nfs41_s
>  	unsigned long timestamp;
>  	struct nfs4_client *clp;
>  
> -	if (!session || !(clp = session->client)) {
> -		printk(KERN_EMERG "%s is NULL!!!\n", (!session)?"session":"clp");
> -		BUG();
> -	}
> +	BUG_ON(!session);

Rahul, this BUG_ON introduces a bug :-(
Previously the function just returned if !session,
now it BUG()'s.

> +	clp = session->client;
> +	BUG_ON(!clp);
>  



More information about the pNFS mailing list