Whamcloud - gitweb
landing fix for bug 12227.
authornikita <nikita>
Thu, 21 Jun 2007 21:31:08 +0000 (21:31 +0000)
committernikita <nikita>
Thu, 21 Jun 2007 21:31:08 +0000 (21:31 +0000)
lnet/ChangeLog
lnet/include/libcfs/linux/linux-time.h

index 959a299..99aeb85 100644 (file)
@@ -1,4 +1,4 @@
-2007-04-23  Cluster File Systems, Inc. <info@clusterfs.com>
+2006-06-22  Cluster File Systems, Inc. <info@clusterfs.com>
        * version 1.4.11 / 1.6.1
        * Support for networks:
        socklnd   - kernels up to 2.6.16
        * version 1.4.11 / 1.6.1
        * Support for networks:
        socklnd   - kernels up to 2.6.16
        ptllnd    - Portals 3.3 / UNICOS/lc 1.5.x, 2.0.x
        * bug fixes
 
        ptllnd    - Portals 3.3 / UNICOS/lc 1.5.x, 2.0.x
        * bug fixes
 
+Severity   : minor
+Frequency  : rare
+Bugzilla   : 12227
+Description: cfs_duration_{u,n}sec() wrongly calculate nanosecond part of
+            struct timeval.
+Details    : do_div() macro is used incorrectly.
+
+2007-04-23  Cluster File Systems, Inc. <info@clusterfs.com>
+
 Severity   : normal
 Bugzilla   : 11680
 Description: make panic on lbug configurable
 Severity   : normal
 Bugzilla   : 11680
 Description: make panic on lbug configurable
index e928387..56523e2 100644 (file)
@@ -238,7 +238,8 @@ static inline void cfs_duration_usec(cfs_duration_t d, struct timeval *s)
 
         s->tv_sec = d / HZ;
         t = (d - (cfs_duration_t)s->tv_sec * HZ) * ONE_MILLION;
 
         s->tv_sec = d / HZ;
         t = (d - (cfs_duration_t)s->tv_sec * HZ) * ONE_MILLION;
-        s->tv_usec = do_div (t, HZ);
+        do_div(t, HZ);
+        s->tv_usec = t;
 #else
         s->tv_sec = d / HZ;
         s->tv_usec = ((d - (cfs_duration_t)s->tv_sec * HZ) * ONE_MILLION) / HZ;
 #else
         s->tv_sec = d / HZ;
         s->tv_usec = ((d - (cfs_duration_t)s->tv_sec * HZ) * ONE_MILLION) / HZ;
@@ -252,7 +253,8 @@ static inline void cfs_duration_nsec(cfs_duration_t d, struct timespec *s)
 
         s->tv_sec = d / HZ;
         t = (d - s->tv_sec * HZ) * ONE_BILLION;
 
         s->tv_sec = d / HZ;
         t = (d - s->tv_sec * HZ) * ONE_BILLION;
-        s->tv_nsec = do_div (t, HZ);
+        do_div(t, HZ);
+        s->tv_nsec = t;
 #else
         s->tv_sec = d / HZ;
         s->tv_nsec = ((d - s->tv_sec * HZ) * ONE_BILLION) / HZ;
 #else
         s->tv_sec = d / HZ;
         s->tv_nsec = ((d - s->tv_sec * HZ) * ONE_BILLION) / HZ;