Whamcloud - gitweb
Branch b1_8
authoradilger <adilger>
Fri, 4 Jul 2008 23:34:36 +0000 (23:34 +0000)
committeradilger <adilger>
Fri, 4 Jul 2008 23:34:36 +0000 (23:34 +0000)
Remove spurious LPROCFS_EXIT() that is breaking the semaphore refcount.
b=16288
i=adilger (wangdi original patch)

lustre/obdclass/lprocfs_status.c

index 3961596..4e9b212 100644 (file)
@@ -204,7 +204,6 @@ int lprocfs_evict_client_release(struct inode *inode, struct file *f)
 
         atomic_dec(&obd->obd_evict_inprogress);
         wake_up(&obd->obd_evict_inprogress_waitq);
-        LPROCFS_EXIT();
 
         return 0;
 }
@@ -360,11 +359,13 @@ int lprocfs_wr_uint(struct file *file, const char *buffer,
                     unsigned long count, void *data)
 {
         unsigned *p = data;
-        char dummy[MAX_STRING_SIZE + 1], *end;
+        char dummy[MAX_STRING_SIZE + 1] = { '\0' }, *end;
         unsigned long tmp;
 
-        dummy[MAX_STRING_SIZE] = '\0';
-        if (copy_from_user(dummy, buffer, MAX_STRING_SIZE))
+        if (count >= sizeof(dummy) || count == 0)
+                return -EINVAL;
+
+        if (copy_from_user(dummy, buffer, count))
                 return -EFAULT;
 
         tmp = simple_strtoul(dummy, &end, 0);