Whamcloud - gitweb
land b_md onto HEAD. the highlights:
[fs/lustre-release.git] / lustre / obdecho / echo_client.c
index 763ddb8..3d2f222 100644 (file)
@@ -31,7 +31,7 @@
 #include <linux/lustre_debug.h>
 #include <linux/lprocfs_status.h>
 
-static int echo_iocontrol(long cmd, struct lustre_handle *obdconn, int len,
+static int echo_iocontrol(unsigned int cmd, struct lustre_handle *obdconn, int len,
                           void *karg, void *uarg)
 {
         struct obd_device *obd = class_conn2obd(obdconn);
@@ -57,8 +57,10 @@ static int echo_iocontrol(long cmd, struct lustre_handle *obdconn, int len,
         case OBD_IOC_CREATE: {
                 struct lov_stripe_md *tmp_lsm = NULL;
                 rc = obd_create(&ec->conn, &data->ioc_obdo1, &tmp_lsm);
-                if (lsm)
+                if (lsm && tmp_lsm ) {
                         memcpy(lsm, tmp_lsm, sizeof(*tmp_lsm));
+                        data->ioc_conn2 = 1;
+                }
 
                 GOTO(out, rc);
         }
@@ -182,7 +184,8 @@ static int echo_iocontrol(long cmd, struct lustre_handle *obdconn, int len,
                 GOTO(out, rc);
         }
         default:
-                return -ENOTTY;
+                CERROR ("echo_ioctl(): unrecognised ioctl %#lx\n", cmd);
+                GOTO (out, rc = -ENOTTY);
         }
 
  out: