Whamcloud - gitweb
Consider the type while finding min.
authorgirish <girish>
Wed, 27 Aug 2008 12:36:04 +0000 (12:36 +0000)
committergirish <girish>
Wed, 27 Aug 2008 12:36:04 +0000 (12:36 +0000)
lustre/mdt/mdt_lproc.c

index dd8c18a..ffb2c41 100644 (file)
@@ -192,8 +192,8 @@ static int lprocfs_wr_identity_upcall(struct file *file, const char *buffer,
                 return -EINVAL;
         }
 
-        if (copy_from_user(kernbuf, buffer,
-                           min(count, UC_CACHE_UPCALL_MAXPATH - 1)))
+        if (copy_from_user(kernbuf, buffer, min_t(unsigned long, count,
+                                                  UC_CACHE_UPCALL_MAXPATH - 1)))
                 return -EFAULT;
 
         /* Remove any extraneous bits from the upcall (e.g. linefeeds) */