Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2c77507
)
If we are passed a bad connection handle don't oops.
author
adilger
<adilger>
Fri, 4 Oct 2002 08:00:09 +0000
(08:00 +0000)
committer
adilger
<adilger>
Fri, 4 Oct 2002 08:00:09 +0000
(08:00 +0000)
lustre/lib/client.c
patch
|
blob
|
history
diff --git
a/lustre/lib/client.c
b/lustre/lib/client.c
index
8233336
..
93c9e03
100644
(file)
--- a/
lustre/lib/client.c
+++ b/
lustre/lib/client.c
@@
-182,11
+182,19
@@
int client_obd_disconnect(struct lustre_handle *conn)
{
struct obd_device *obd = class_conn2obd(conn);
struct client_obd *cli = &obd->u.cli;
{
struct obd_device *obd = class_conn2obd(conn);
struct client_obd *cli = &obd->u.cli;
- int rq_opc
= (obd->obd_type->typ_ops->o_brw) ? OST_DISCONNECT : MDS_DISCONNECT
;
+ int rq_opc;
struct ptlrpc_request *request = NULL;
int rc, err;
ENTRY;
struct ptlrpc_request *request = NULL;
int rc, err;
ENTRY;
+ if (!obd) {
+ CERROR("invalid connection for disconnect: addr "LPX64
+ ", cookie "LPX64"\n", conn ? conn->addr : -1UL,
+ conn ? conn->cookie : -1UL);
+ RETURN(-EINVAL);
+ }
+
+ rq_opc = obd->obd_type->typ_ops->o_brw ? OST_DISCONNECT:MDS_DISCONNECT;
down(&cli->cl_sem);
if (!cli->cl_conn_count) {
CERROR("disconnecting disconnected device (%s)\n",
down(&cli->cl_sem);
if (!cli->cl_conn_count) {
CERROR("disconnecting disconnected device (%s)\n",