Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1461774
| From | Deepa Dinamani <deepa.kernel@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v4 13/26] fs: cifs: Replace CURRENT_TIME with ktime_get_real_ts() |
| Date | 2016-08-14 12:30 +0200 |
| Message-ID | <s60Q2-6Gs-29@gated-at.bofh.it> (permalink) |
| References | <s5YXT-5oj-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
This is in preparation for the patch that transitions vfs timestamps to use 64 bit time and hence make them y2038 safe. CURRENT_TIME macro will be deleted before merging the aforementioned patch. Filesystem times will use current_fs_time() instead of CURRENT_TIME. Use ktime_get_real_ts() here as this is not filesystem time. ktime_get_real_ts() returns the timestamp in ns which can be used to calculate network time for NTLMv2 authentication timestamp. All cifs timestamps currently use timespec internally. This timestamp can also be transitioned into using timespec64 when all other timestamps for cifs is transitioned to use timespec64. Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Cc: Steve French <sfrench@samba.org> --- fs/cifs/cifsencrypt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c index 8347c90..fd01bf0 100644 --- a/fs/cifs/cifsencrypt.c +++ b/fs/cifs/cifsencrypt.c @@ -471,6 +471,7 @@ find_timestamp(struct cifs_ses *ses) unsigned char *blobptr; unsigned char *blobend; struct ntlmssp2_name *attrptr; + struct timespec ts; if (!ses->auth_key.len || !ses->auth_key.response) return 0; @@ -495,7 +496,8 @@ find_timestamp(struct cifs_ses *ses) blobptr += attrsize; /* advance attr value */ } - return cpu_to_le64(cifs_UnixTimeToNT(CURRENT_TIME)); + ktime_get_real_ts(&ts); + return cpu_to_le64(cifs_UnixTimeToNT(ts)); } static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash, -- 1.9.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[GIT PULL] [PATCH v4 00/26] Delete CURRENT_TIME and CURRENT_TIME_SEC macros Deepa Dinamani <deepa.kernel@gmail.com> - 2016-08-14 10:30 +0200
[PATCH v4 22/26] libceph: Replace CURRENT_TIME with ktime_get_real_ts Deepa Dinamani <deepa.kernel@gmail.com> - 2016-08-14 12:30 +0200
[PATCH v4 05/26] fs: Replace current_fs_time() with current_time() Deepa Dinamani <deepa.kernel@gmail.com> - 2016-08-14 12:30 +0200
[PATCH v4 24/26] fnic: Use time64_t to represent trace timestamps Deepa Dinamani <deepa.kernel@gmail.com> - 2016-08-14 12:30 +0200
[PATCH v4 13/26] fs: cifs: Replace CURRENT_TIME with ktime_get_real_ts() Deepa Dinamani <deepa.kernel@gmail.com> - 2016-08-14 12:30 +0200
[PATCH v4 07/26] fs: jfs: Replace CURRENT_TIME_SEC by current_time() Deepa Dinamani <deepa.kernel@gmail.com> - 2016-08-14 12:40 +0200
[PATCH v4 21/26] block: Replace CURRENT_TIME with ktime_get_real_ts Deepa Dinamani <deepa.kernel@gmail.com> - 2016-08-14 12:40 +0200
[PATCH v4 14/26] fs: cifs: Replace CURRENT_TIME by get_seconds Deepa Dinamani <deepa.kernel@gmail.com> - 2016-08-14 12:40 +0200
[PATCH v4 06/26] fs: ufs: Use ktime_get_real_ts64() for birthtime Deepa Dinamani <deepa.kernel@gmail.com> - 2016-08-14 12:40 +0200
[PATCH v4 20/26] fs: nfs: Make nfs boot time y2038 safe Deepa Dinamani <deepa.kernel@gmail.com> - 2016-08-14 12:40 +0200
[PATCH v4 23/26] fs: ceph: Replace current_fs_time for request stamp Deepa Dinamani <deepa.kernel@gmail.com> - 2016-08-14 12:50 +0200
[PATCH v4 11/26] fs: udf: Replace CURRENT_TIME with current_time() Deepa Dinamani <deepa.kernel@gmail.com> - 2016-08-14 12:50 +0200
[PATCH v4 09/26] fs: ubifs: Replace CURRENT_TIME_SEC with current_time Deepa Dinamani <deepa.kernel@gmail.com> - 2016-08-14 12:50 +0200
[PATCH v4 18/26] fs: ocfs2: Replace CURRENT_TIME macro Deepa Dinamani <deepa.kernel@gmail.com> - 2016-08-14 13:00 +0200
[PATCH v4 10/26] fs: btrfs: Use ktime_get_real_ts for root ctime Deepa Dinamani <deepa.kernel@gmail.com> - 2016-08-14 13:00 +0200
Re: [PATCH v4 10/26] fs: btrfs: Use ktime_get_real_ts for root ctime David Sterba <dsterba@suse.cz> - 2016-08-15 15:30 +0200
[PATCH v4 17/26] fs: ocfs2: Use time64_t to represent orphan scan times Deepa Dinamani <deepa.kernel@gmail.com> - 2016-08-14 13:10 +0200
[PATCH v4 15/26] fs: f2fs: Use ktime_get_real_seconds for sit_info times Deepa Dinamani <deepa.kernel@gmail.com> - 2016-08-14 13:10 +0200
[PATCH v4 26/26] time: Delete CURRENT_TIME_SEC and CURRENT_TIME Deepa Dinamani <deepa.kernel@gmail.com> - 2016-08-14 13:20 +0200
[PATCH v4 08/26] fs: ext4: Use current_time() for inode timestamps Deepa Dinamani <deepa.kernel@gmail.com> - 2016-08-14 13:20 +0200
[PATCH v4 02/26] fs: proc: Delete inode time initializations in proc_alloc_inode() Deepa Dinamani <deepa.kernel@gmail.com> - 2016-08-14 13:30 +0200
[PATCH v4 12/26] fs: cifs: Replace CURRENT_TIME by current_time() Deepa Dinamani <deepa.kernel@gmail.com> - 2016-08-14 13:40 +0200
[PATCH v4 19/26] audit: Use timespec64 to represent audit timestamps Deepa Dinamani <deepa.kernel@gmail.com> - 2016-08-14 13:40 +0200
[PATCH v4 25/26] time: Delete current_fs_time() function Deepa Dinamani <deepa.kernel@gmail.com> - 2016-08-14 13:50 +0200
Re: [PATCH v4 25/26] time: Delete current_fs_time() function John Stultz <john.stultz@linaro.org> - 2016-08-17 22:10 +0200
[PATCH v4 16/26] drivers: staging: lustre: Replace CURRENT_TIME with current_time() Deepa Dinamani <deepa.kernel@gmail.com> - 2016-08-14 14:00 +0200
[PATCH v4 01/26] vfs: Add current_time() api Deepa Dinamani <deepa.kernel@gmail.com> - 2016-08-14 16:50 +0200
Re: [GIT PULL] [PATCH v4 00/26] Delete CURRENT_TIME and CURRENT_TIME_SEC macros Greg KH <gregkh@linuxfoundation.org> - 2016-08-15 18:30 +0200
Re: [GIT PULL] [PATCH v4 00/26] Delete CURRENT_TIME and CURRENT_TIME_SEC macros Deepa Dinamani <deepa.kernel@gmail.com> - 2016-08-16 20:20 +0200
Re: [GIT PULL] [PATCH v4 00/26] Delete CURRENT_TIME and CURRENT_TIME_SEC macros Greg KH <gregkh@linuxfoundation.org> - 2016-08-16 21:00 +0200
Re: [GIT PULL] [PATCH v4 00/26] Delete CURRENT_TIME and CURRENT_TIME_SEC macros Arnd Bergmann <arnd@arndb.de> - 2016-08-23 17:10 +0200
csiph-web