提交 2f74f972 编写于 作者: H Harshula Jayasuriya 提交者: J. Bruce Fields

sunrpc: prepare NFS for 2038

1) The kernel sunrpc code needs to handle seconds since epoch
greater than 2147483647. This means functions that parse time
as an int need to handle it as time_t.

2) The kernel changes must be accompanied by userspace changes
in nfs-utils.
Signed-off-by: NHarshula Jayasuriya <harshula@redhat.com>
Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
上级 b1948a64
......@@ -264,12 +264,30 @@ static inline int get_uint(char **bpp, unsigned int *anint)
return 0;
}
static inline int get_time(char **bpp, time_t *time)
{
char buf[50];
long long ll;
int len = qword_get(bpp, buf, sizeof(buf));
if (len < 0)
return -EINVAL;
if (len == 0)
return -ENOENT;
if (kstrtoll(buf, 0, &ll))
return -EINVAL;
*time = (time_t)ll;
return 0;
}
static inline time_t get_expiry(char **bpp)
{
int rv;
time_t rv;
struct timespec boot;
if (get_int(bpp, &rv))
if (get_time(bpp, &rv))
return 0;
if (rv < 0)
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册