Message ID | CAH2r5mumvJxzROhpcgTvXW7N_Ghquyx8jqzW1PsgR9XMbVgBVQ@mail.gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c index 6834b9c..3e17e9b 100644 --- a/fs/cifs/netmisc.c +++ b/fs/cifs/netmisc.c @@ -925,11 +925,19 @@ cifs_NTtimeToUnix(__le64 ntutc) /* BB what about the timezone? BB */ /* Subtract the NTFS time offset, then convert to 1s intervals. */ - u64 t; + s64 t; t = le64_to_cpu(ntutc) - NTFS_TIME_OFFSET; - ts.tv_nsec = do_div(t, 10000000) * 100; - ts.tv_sec = t; + + if (t < 0) { + t = -t; + ts.tv_nsec = -(do_div(t, 10000000) * 100); + ts.tv_sec = -t; + } else { + ts.tv_nsec = do_div(t, 10000000) * 100; + ts.tv_sec = t; + } + return ts; }