Commit d7b88513 authored by Dominique Quatravaux's avatar Dominique Quatravaux Committed by Linus Torvalds

uml: fix hostfs tv_usec calculations

To convert from tv_nsec to tv_usec, one needs to divide by 1000, not multiply.
Signed-off-by: default avatarDominique Quatravaux <dominique@quatravaux.org>
Signed-off-by: default avatarJeff Dike <jdike@linux.intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c5d4bb17
......@@ -285,17 +285,17 @@ int set_attr(const char *file, struct hostfs_iattr *attrs, int fd)
return err;
times[0].tv_sec = atime_ts.tv_sec;
times[0].tv_usec = atime_ts.tv_nsec * 1000;
times[0].tv_usec = atime_ts.tv_nsec / 1000;
times[1].tv_sec = mtime_ts.tv_sec;
times[1].tv_usec = mtime_ts.tv_nsec * 1000;
times[1].tv_usec = mtime_ts.tv_nsec / 1000;
if (attrs->ia_valid & HOSTFS_ATTR_ATIME_SET) {
times[0].tv_sec = attrs->ia_atime.tv_sec;
times[0].tv_usec = attrs->ia_atime.tv_nsec * 1000;
times[0].tv_usec = attrs->ia_atime.tv_nsec / 1000;
}
if (attrs->ia_valid & HOSTFS_ATTR_MTIME_SET) {
times[1].tv_sec = attrs->ia_mtime.tv_sec;
times[1].tv_usec = attrs->ia_mtime.tv_nsec * 1000;
times[1].tv_usec = attrs->ia_mtime.tv_nsec / 1000;
}
if (fd >= 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment