Whamcloud - gitweb
* landed unified portals (b_hd_cleanup_merge_singleportals) on HEAD
[fs/lustre-release.git] / lustre / portals / libcfs / module.c
index 3703013..a2422e3 100644 (file)
@@ -327,6 +327,8 @@ libcfs_nal_cmd(struct portals_cfg *pcfg)
                 CDEBUG(D_IOCTL, "calling handler nal: %d, cmd: %d\n", nal, 
                        pcfg->pcfg_command);
                 rc = cmd->nch_handler(pcfg, cmd->nch_private);
+        } else {
+                CERROR("invalid nal: %d, cmd: %d\n", nal, pcfg->pcfg_command);
         }
         up(&nal_cmd_sem);
 
@@ -413,15 +415,15 @@ static int libcfs_ioctl(struct inode *inode, struct file *file,
                 portals_debug_mark_buffer(data->ioc_inlbuf1);
                 RETURN(0);
 #if LWT_SUPPORT
-        case IOC_PORTAL_LWT_CONTROL: 
+        case IOC_PORTAL_LWT_CONTROL:
                 err = lwt_control (data->ioc_flags, data->ioc_misc);
                 break;
-                
+
         case IOC_PORTAL_LWT_SNAPSHOT: {
                 cycles_t   now;
                 int        ncpu;
                 int        total_size;
-                
+
                 err = lwt_snapshot (&now, &ncpu, &total_size,
                                     data->ioc_pbuf1, data->ioc_plen1);
                 data->ioc_nid = now;
@@ -429,15 +431,15 @@ static int libcfs_ioctl(struct inode *inode, struct file *file,
                 data->ioc_misc = total_size;
 
                 /* Hedge against broken user/kernel typedefs (e.g. cycles_t) */
-                data->ioc_nid = sizeof(lwt_event_t);
-                data->ioc_nid2 = offsetof(lwt_event_t, lwte_where);
+                data->ioc_nid2 = sizeof(lwt_event_t);
+                data->ioc_nid3 = offsetof(lwt_event_t, lwte_where);
 
                 if (err == 0 &&
                     copy_to_user((char *)arg, data, sizeof (*data)))
                         err = -EFAULT;
                 break;
         }
-                
+
         case IOC_PORTAL_LWT_LOOKUP_STRING:
                 err = lwt_lookup_string (&data->ioc_count, data->ioc_pbuf1,
                                          data->ioc_pbuf2, data->ioc_plen2);
@@ -456,7 +458,7 @@ static int libcfs_ioctl(struct inode *inode, struct file *file,
                         break;
                 }
 
-                if (copy_from_user(&pcfg, (void *)data->ioc_pbuf1, 
+                if (copy_from_user(&pcfg, (void *)data->ioc_pbuf1,
                                    sizeof(pcfg))) {
                         err = -EFAULT;
                         break;
@@ -467,7 +469,7 @@ static int libcfs_ioctl(struct inode *inode, struct file *file,
                 err = libcfs_nal_cmd(&pcfg);
 
                 if (err == 0 &&
-                    copy_to_user((char *)data->ioc_pbuf1, &pcfg, 
+                    copy_to_user((char *)data->ioc_pbuf1, &pcfg,
                                  sizeof (pcfg)))
                         err = -EFAULT;
                 break;