Replace time_t type and get_seconds function which are not y2038 safe on 32-bit systems. Function ktime_get_seconds use monotonic instead of real time and therefore will not cause overflow.
Signed-off-by: Ksenija Stanojevic ksenija.stanojevic@gmail.com --- fs/nfsd/netns.h | 2 +- fs/nfsd/nfs4state.c | 2 +- fs/nfsd/nfsctl.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/nfsd/netns.h b/fs/nfsd/netns.h index 85b114f..aeaf896 100644 --- a/fs/nfsd/netns.h +++ b/fs/nfsd/netns.h @@ -95,7 +95,7 @@ struct nfsd_net { struct nfsd4_client_tracking_ops *client_tracking_ops;
u32 nfsd4_lease; - time_t nfsd4_grace; + u32 nfsd4_grace;
bool nfsd_net_up; bool lockd_up; diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 4bceb878..4b3c87d 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -6608,7 +6608,7 @@ nfs4_state_start_net(struct net *net) nn->nfsd4_manager.block_opens = true; locks_start_grace(net, &nn->nfsd4_manager); nfsd4_client_tracking_init(net); - printk(KERN_INFO "NFSD: starting %ld-second grace period (net %p)\n", + printk(KERN_INFO "NFSD: starting %x-second grace period (net %p)\n", nn->nfsd4_grace, net); queue_delayed_work(laundry_wq, &nn->laundromat_work, nn->nfsd4_grace * HZ); return 0; diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index 6e0cfd6..e1709ce 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c @@ -960,7 +960,7 @@ static ssize_t __nfsd4_write_time(struct file *file, char *buf, size_t size, *time = i; }
- return scnprintf(buf, SIMPLE_TRANSACTION_LIMIT, "%ld\n", *time); + return scnprintf(buf, (u32)SIMPLE_TRANSACTION_LIMIT, "%x\n", *time); }
static ssize_t nfsd4_write_time(struct file *file, char *buf, size_t size,