From cb614135db8174d14010f2aa8b8a4ca873400d59 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sun, 18 Jan 2004 18:57:09 -0800 Subject: [PATCH] [PATCH] kNFSd: Honour SUN NFSv2 hack for "set times to server time. From: NeilBrown From: Greg Banks , see comment in code. --- fs/nfsd/nfsxdr.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/fs/nfsd/nfsxdr.c b/fs/nfsd/nfsxdr.c index 1f7d8ecfe3e57..6c87eac22769e 100644 --- a/fs/nfsd/nfsxdr.c +++ b/fs/nfsd/nfsxdr.c @@ -130,6 +130,17 @@ decode_sattr(u32 *p, struct iattr *iap) iap->ia_valid |= ATTR_MTIME | ATTR_MTIME_SET; iap->ia_mtime.tv_sec = tmp; iap->ia_mtime.tv_nsec = tmp1 * 1000; + /* + * Passing the invalid value useconds=1000000 for mtime + * is a Sun convention for "set both mtime and atime to + * current server time". It's needed to make permissions + * checks for the "touch" program across v2 mounts to + * Solaris and Irix boxes work correctly. See description of + * sattr in section 6.1 of "NFS Illustrated" by + * Brent Callaghan, Addison-Wesley, ISBN 0-201-32750-5 + */ + if (tmp1 == 1000000) + iap->ia_valid &= ~(ATTR_ATIME_SET|ATTR_MTIME_SET); } return p; } -- 2.53.0