Not to be fixed
Created: Mar 18, 2013
Updated: Apr 19, 2018
Resolved Date: Apr 17, 2018
Previous ID: LIN4-12810
Found In Version: 6.0
Severity: Severe
Applicable for: Wind River Linux 6
Component/s: Kernel
after set the date to 1970-01-01 executing exportfs -av failed.
root 822 0.0 0.0 2844 408 pts/1 D+ 00:00 0:00 mount -t nfs 192.168.0.19:/tmp/nfsserver/share /mnt/nfs
The below fix can resolve customer's problem, but before apply this fix, we need to merge
three upstream patches:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=33ee3b2e2eb9b4b6c64dcf9ed66e2ac3124e748c
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=a007c4c3e943ecc054a806c259d95420a188754b
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=8d96b10639fb402357b75b055b1e82a65ff95050
And then apply the below fix:
###############################################################
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index 8274f88..4f0b50e 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -91,6 +91,7 @@ static int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
char *ep;
struct svc_expkey key;
struct svc_expkey *ek = NULL;
+ unsigned int expiry;
if (mesg[mlen-1] != '\n')
return -EINVAL;
@@ -128,9 +129,9 @@ static int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
/* OK, we seem to have a valid key */
key.h.flags = 0;
- key.h.expiry_time = get_expiry(&mesg);
- if (key.h.expiry_time == 0)
+ if (get_uint(&mesg, &expiry) < 0)
goto out;
+ key.h.expiry_time = expiry;
key.ek_client = dom;
key.ek_fsidtype = fsidtype;
@@ -501,6 +502,7 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
struct auth_domain *dom = NULL;
struct svc_export exp = {}, *expp;
int an_int;
+ unsigned int expiry;
if (mesg[mlen-1] != '\n')
return -EINVAL;
@@ -539,9 +541,9 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
/* expiry */
err = -EINVAL;
- exp.h.expiry_time = get_expiry(&mesg);
- if (exp.h.expiry_time == 0)
+ if (get_uint(&mesg, &expiry) < 0)
goto out3;
+ exp.h.expiry_time = expiry;
/* flags */
err = get_int(&mesg, &an_int);
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
index b81e790..f3d029e 100644
--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -196,7 +196,7 @@ static int rsi_parse(struct cache_detail *cd,
char *ep;
int len;
struct rsi rsii, *rsip = NULL;
- time_t expiry;
+ unsigned int expiry;
int status = -EINVAL;
memset(&rsii, 0, sizeof(rsii));
@@ -223,9 +223,8 @@ static int rsi_parse(struct cache_detail *cd,
rsii.h.flags = 0;
/* expiry */
- expiry = get_expiry(&mesg);
status = -EINVAL;
- if (expiry == 0)
+ if (get_uint(&mesg, &expiry) < 0)
goto out;
/* major/minor */
@@ -427,7 +426,7 @@ static int rsc_parse(struct cache_detail *cd,
char *buf = mesg;
int len, rv;
struct rsc rsci, *rscp = NULL;
- time_t expiry;
+ unsigned int expiry;
int status = -EINVAL;
struct gss_api_mech *gm = NULL;
@@ -441,9 +440,8 @@ static int rsc_parse(struct cache_detail *cd,
rsci.h.flags = 0;
/* expiry */
- expiry = get_expiry(&mesg);
status = -EINVAL;
- if (expiry == 0)
+ if (get_uint(&mesg, &expiry) < 0)
goto out;
rscp = rsc_lookup(&rsci);
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
index 2073116..fe931ec 100644
--- a/net/sunrpc/svcauth_unix.c
+++ b/net/sunrpc/svcauth_unix.c
@@ -200,7 +200,7 @@ static int ip_map_parse(struct cache_detail *cd,
struct ip_map *ipmp;
struct auth_domain *dom;
- time_t expiry;
+ unsigned int expiry;
if (mesg[mlen-1] != '\n')
return -EINVAL;
@@ -233,8 +233,7 @@ static int ip_map_parse(struct cache_detail *cd,
return -EINVAL;
}
- expiry = get_expiry(&mesg);
- if (expiry ==0)
+ if (get_uint(&mesg, &expiry) < 0)
return -EINVAL;
/* domainname, or empty for NEGATIVE */
@@ -551,7 +550,7 @@ static int unix_gid_parse(struct cache_detail *cd,
int rv;
int i;
int err;
- time_t expiry;
+ unsigned int expiry;
struct unix_gid ug, *ugp;
if (mlen <= 0 || mesg[mlen-1] != '\n')
@@ -563,8 +562,7 @@ static int unix_gid_parse(struct cache_detail *cd,
return -EINVAL;
ug.uid = uid;
- expiry = get_expiry(&mesg);
- if (expiry == 0)
+ if (get_uint(&mesg, &expiry) < 0)
return -EINVAL;
rv = get_int(&mesg, &gids);
###############################################################
1. ../configure --enable-board=common_pc --enable-kernel=standard --enable-rootfs=glibc_std
2. make -C build linux.menuconfig
select File Systems-->Network File Systems--> NFS server support,
NFS server support for NFS version 3,
NFS server support for the NFSv3 ACL protocol extension,
NFS server support for NFS version 4 (EXPERIMENTAL)
3. make fs; make usb-image
4. boot the target with usb storage and setup the environment for NFS server:
# service nfs start
# mkdir /tmp/nfsserver
# cat /etc/exports
/tmp/nfsserver *(fsid=0,rw,async,no_root_squash,no_subtree_check)
# date -s "19700101"
Thu Jan 1 00:00:00 GMT 1970
# exportfs -av
exporting *:/tmp/nfsserver
exportfs: /tmp/nfsserver does not support NFS export
5. On the nfs client side:
# sudo mount -t nfs 192.168.100.10:/tmp/nfsserver /mnt/nfs
Then mount hang forever.