[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <200907281704.56870.bzolnier@gmail.com>
Date: Tue, 28 Jul 2009 17:04:56 +0200
From: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
To: Trond.Myklebust@...app.com
Cc: linux-nfs@...r.kernel.org, linux-kernel@...r.kernel.org,
Dan Carpenter <error27@...il.com>, corbet@....net,
eteo@...hat.com, Julia Lawall <julia@...u.dk>
Subject: [PATCH] nfs: remove superfluous BUG_ON()s
From: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
Subject: [PATCH] nfs: remove superfluous BUG_ON()s
Remove duplicated BUG_ON()s from nfs[4]_create_server()
(we make the same checks earlier in both functions).
This takes care of the following entries from Dan's list:
fs/nfs/client.c +1078 nfs_create_server(47) warning: variable derefenced before check 'server->nfs_client'
fs/nfs/client.c +1079 nfs_create_server(48) warning: variable derefenced before check 'server->nfs_client->rpc_ops'
fs/nfs/client.c +1363 nfs4_create_server(43) warning: variable derefenced before check 'server->nfs_client'
fs/nfs/client.c +1364 nfs4_create_server(44) warning: variable derefenced before check 'server->nfs_
Reported-by: Dan Carpenter <error27@...il.com>
Cc: corbet@....net
Cc: eteo@...hat.com
Cc: Julia Lawall <julia@...u.dk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
---
fs/nfs/client.c | 8 --------
1 file changed, 8 deletions(-)
Index: b/fs/nfs/client.c
===================================================================
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -1075,10 +1075,6 @@ struct nfs_server *nfs_create_server(con
(unsigned long long) server->fsid.major,
(unsigned long long) server->fsid.minor);
- BUG_ON(!server->nfs_client);
- BUG_ON(!server->nfs_client->rpc_ops);
- BUG_ON(!server->nfs_client->rpc_ops->file_inode_ops);
-
spin_lock(&nfs_client_lock);
list_add_tail(&server->client_link, &server->nfs_client->cl_superblocks);
list_add_tail(&server->master_link, &nfs_volume_list);
@@ -1360,10 +1356,6 @@ struct nfs_server *nfs4_create_server(co
if (server->namelen == 0 || server->namelen > NFS4_MAXNAMLEN)
server->namelen = NFS4_MAXNAMLEN;
- BUG_ON(!server->nfs_client);
- BUG_ON(!server->nfs_client->rpc_ops);
- BUG_ON(!server->nfs_client->rpc_ops->file_inode_ops);
-
spin_lock(&nfs_client_lock);
list_add_tail(&server->client_link, &server->nfs_client->cl_superblocks);
list_add_tail(&server->master_link, &nfs_volume_list);
--
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