Whamcloud - gitweb
Branch b1_8
authorbobijam <bobijam>
Mon, 15 Jun 2009 01:42:31 +0000 (01:42 +0000)
committerbobijam <bobijam>
Mon, 15 Jun 2009 01:42:31 +0000 (01:42 +0000)
b=17213
i=andrew.perepechko (panda)
i=johann

avoid getting client uuid from invalid client_obd.

lustre/llite/llite_lib.c

index 475f599..f12d150 100644 (file)
@@ -2429,9 +2429,14 @@ int ll_obd_statfs(struct inode *inode, void *arg)
                 GOTO(out_statfs, rc = -EFAULT);
 
 out_uuid:
-        if (copy_to_user(data->ioc_pbuf2, obd2cli_tgt(client_obd),
-                         data->ioc_plen2))
-                rc = -EFAULT;
+        if (client_obd) {
+                if (copy_to_user(data->ioc_pbuf2, obd2cli_tgt(client_obd),
+                                 data->ioc_plen2))
+                        rc = -EFAULT;
+        } else {
+                if (copy_to_user(data->ioc_pbuf2, "Unknown UUID", 13))
+                        rc = -EFAULT;
+        }
 
 out_statfs:
         if (buf)