nfsdcltrack: Use uint64_t instead of time_t

Signed-off-by: Steve Dickson <steved@redhat.com>
This commit is contained in:
Steve Dickson 2021-07-31 11:37:42 -04:00
parent 02639cf6a7
commit 8dacf9facd
2 changed files with 62 additions and 1 deletions

View File

@ -0,0 +1,57 @@
commit 71a09e1dbf6c988e17d18f36117a73127d199d20
Author: Steve Dickson <steved@redhat.com>
Date: Tue Jul 27 21:12:17 2021 -0400
nfsdcltrack: Use uint64_t instead of time_t
With recent commits (4f2a5b64,5a53426c) that fixed
compile errors on x86_64 machines, caused similar
errors on i686 machines.
The variable type that was being used was a time_t,
which changes size between architects, which
caused the compile error.
Changing the variable to uint64_t fixed the issue.
Signed-off-by: Steve Dickson <steved@redhat.com>
diff --git a/utils/nfsdcltrack/nfsdcltrack.c b/utils/nfsdcltrack/nfsdcltrack.c
index 0b37c094..7c1c4bcc 100644
--- a/utils/nfsdcltrack/nfsdcltrack.c
+++ b/utils/nfsdcltrack/nfsdcltrack.c
@@ -508,7 +508,7 @@ cltrack_gracedone(const char *timestr)
{
int ret;
char *tail;
- time_t gracetime;
+ uint64_t gracetime;
ret = sqlite_prepare_dbh(storagedir);
diff --git a/utils/nfsdcltrack/sqlite.c b/utils/nfsdcltrack/sqlite.c
index cea4a411..cf0c6a45 100644
--- a/utils/nfsdcltrack/sqlite.c
+++ b/utils/nfsdcltrack/sqlite.c
@@ -540,7 +540,7 @@ out_err:
* remove any client records that were not reclaimed since grace_start.
*/
int
-sqlite_remove_unreclaimed(time_t grace_start)
+sqlite_remove_unreclaimed(uint64_t grace_start)
{
int ret;
char *err = NULL;
diff --git a/utils/nfsdcltrack/sqlite.h b/utils/nfsdcltrack/sqlite.h
index 06e7c044..ba8cdfa8 100644
--- a/utils/nfsdcltrack/sqlite.h
+++ b/utils/nfsdcltrack/sqlite.h
@@ -26,7 +26,7 @@ int sqlite_insert_client(const unsigned char *clname, const size_t namelen,
int sqlite_remove_client(const unsigned char *clname, const size_t namelen);
int sqlite_check_client(const unsigned char *clname, const size_t namelen,
const bool has_session);
-int sqlite_remove_unreclaimed(const time_t grace_start);
+int sqlite_remove_unreclaimed(const uint64_t grace_start);
int sqlite_query_reclaiming(const time_t grace_start);
#endif /* _SQLITE_H */

View File

@ -2,7 +2,7 @@ Summary: NFS utilities and supporting clients and daemons for the kernel NFS ser
Name: nfs-utils
URL: http://linux-nfs.org/
Version: 2.5.4
Release: 1.rc1%{?dist}
Release: 2.rc1%{?dist}
Epoch: 1
# group all 32bit related archs
@ -18,6 +18,7 @@ Source6: nfs-convert.service
Source7: 10-nfsv4.conf
Patch001: nfs-utils-2.5.5-rc1.patch
Patch002: nfs-utils-2.5.4-nfsdcltrack-uint64_t.patch
Patch100: nfs-utils-1.2.1-statdpath-man.patch
Patch101: nfs-utils-1.2.1-exp-subtree-warn-off.patch
@ -453,6 +454,9 @@ fi
%{_mandir}/*/nfsiostat.8.gz
%changelog
* Sat Jul 31 2021 Steve Dickson <steved@redhat.com> 2.5.4-2.rc1
- nfsdcltrack: Use uint64_t instead of time_t
* Mon Jul 26 2021 Steve Dickson <steved@redhat.com> 2.5.4-1.rc1
- Updated to the latest RC release: nfs-utils-2-5-5.rc1 (bz 1986121)