freebsd-skq/sys
kan c7b0520697 Change nfsserver slightly so that it does not trip over the timestamp
validation code on ZFS.

Problem: when opening file with O_CREAT|O_EXCL NFS has to jump through
extra hoops to ensure O_EXCL semantics. Namely, client supplies of 8
bytes (NFSX_V3CREATEVERF) bytes of verification data to uniquely
identify this create request. Server then creates a new file with access
mode 0, copies received 8 bytes into va_atime member of struct vattr and
attempt to set the atime on file using VOP_SETATTR. If that succeeds, it
fetches file attributes with VOP_GETATTR and verifies that atime
timestamps match.  If timestamps do not match, NFS server concludes it
has probbaly lost the race to another process creating the file with the
same name and bails with EEXIST.

This scheme works OK when exported FS is FFS, but if underlying
filesystem is ZFS _and_ server is running 64bit kernel, it breaks down
due to sanity checking in zfs_setattr function, which refuses to accept
any timestamps which have tv_sec that cannot be represented as 32bit
int. Since struct timespec fields are 64 bit integers on 64bit platforms
and server just copies NFSX_V3CREATEVERF bytes info va_atime, all eight
bytes supplied by client end up in va_atime.tv_sec, forcing it out of
valid 32bit range.

The solution this change implements is simple: it treats
NFSX_V3CREATEVERF as two 32bit integers and unpacks them separately into
va_atime.tv_sec and va_atime.tv_nsec respectively, thus guaranteeing
that tv_sec remains in 32 bit range and ZFS remains happy.

Reviewed by: kib
2008-12-03 17:54:09 +00:00
..
amd64 Remove "[KEEP THIS!]" from COMPAT_43TTY. It's not really that important. 2008-12-02 19:09:08 +00:00
arm Switch to ath hal source code. Note this removes the ath_hal 2008-12-01 16:53:01 +00:00
boot Another, hopefully final set of changes to boot0 and boot0cfg. 2008-12-03 14:53:59 +00:00
bsm Merge OpenBSM 1.1 alpha 2 from the OpenBSM vendor branch to head, both 2008-12-02 23:26:43 +00:00
cam Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
cddl MFp4: Remove assertion that is no longer valid - we now use VOP_CLOSE() in 2008-11-29 12:32:42 +00:00
compat Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
conf Switch to ath hal source code. Note this removes the ath_hal 2008-12-01 16:53:01 +00:00
contrib Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
crypto Fix a potential NULL-pointer dereference in padlock(4). 2008-11-17 19:00:36 +00:00
ddb Collect N identical (or near identical) mkdumpheader() implementations into 2008-10-01 22:08:53 +00:00
dev Fixes for Core2 Extreme support. 2008-12-03 17:30:36 +00:00
fs The timezone byte is a signed value, treat it as such. 2008-11-27 06:21:04 +00:00
gdb
geom Trivial patch to show on which geom has the error been detected. 2008-12-01 15:02:00 +00:00
gnu Adapt to accmode_t changes. 2008-11-14 09:58:16 +00:00
i386 Remove "[KEEP THIS!]" from COMPAT_43TTY. It's not really that important. 2008-12-02 19:09:08 +00:00
ia64 Remove "[KEEP THIS!]" from COMPAT_43TTY. It's not really that important. 2008-12-02 19:09:08 +00:00
isa Allow device hints to wire the unit numbers of devices. 2008-11-18 21:01:54 +00:00
kern Fix a credential reference leak. [1] 2008-12-03 15:54:35 +00:00
kgssapi Call svc_freereq() before returning from the service proc. 2008-11-12 15:31:05 +00:00
libkern Prefix the static shl function with '__' like its parent function __qdivrem to 2008-10-09 20:43:42 +00:00
mips Switch to ath hal source code. Note this removes the ath_hal 2008-12-01 16:53:01 +00:00
modules Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
net Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
net80211 Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
netatalk Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
netgraph Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
netinet Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
netinet6 Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
netipsec Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
netipx Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
netnatm Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
netncp Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
netsmb Implement device cloning for /dev/nsmb, the netsmb control pseudo-device. 2008-11-03 14:23:15 +00:00
nfs
nfs4client Introduce accmode_t. This is required for NFSv4 ACLs - it will be neccessary 2008-10-28 13:44:11 +00:00
nfsclient Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
nfsserver Change nfsserver slightly so that it does not trip over the timestamp 2008-12-03 17:54:09 +00:00
nlm Don't call svc_freereq() before svc_freeargs(). 2008-11-12 15:30:30 +00:00
opencrypto Don't hang if encrypting/decrypting using struct iovecs where one of the 2008-10-30 16:11:07 +00:00
pc98 Remove "[KEEP THIS!]" from COMPAT_43TTY. It's not really that important. 2008-12-02 19:09:08 +00:00
pccard
pci Update if_iqdrops instead of if_ierrors when m_devget(9) fails. 2008-12-03 03:20:18 +00:00
powerpc Remove "[KEEP THIS!]" from COMPAT_43TTY. It's not really that important. 2008-12-02 19:09:08 +00:00
rpc Add a missing call to mtx_destroy(). 2008-11-12 12:21:18 +00:00
security Merge OpenBSM 1.1 alpha 2 from the OpenBSM vendor branch to head, both 2008-12-02 23:26:43 +00:00
sparc64 Remove "[KEEP THIS!]" from COMPAT_43TTY. It's not really that important. 2008-12-02 19:09:08 +00:00
sun4v Remove "[KEEP THIS!]" from COMPAT_43TTY. It's not really that important. 2008-12-02 19:09:08 +00:00
sys kf_offset was supposed to be signed. 2008-12-02 10:39:47 +00:00
tools Remove some unused and broken code that attempted to not invoke locking 2008-11-03 19:57:40 +00:00
ufs Do not lock vnode interlock around reading of v_iflag to check VI_DOOMED. 2008-12-02 11:12:50 +00:00
vm Instead of forcing vn_start_write() to reset mp back to NULL for the 2008-11-16 21:57:54 +00:00
xdr Use the remote address for access control, not the local address. This fixes 2008-11-13 14:36:52 +00:00
xen merge fix for boot-time hang on centos' xen 2008-11-14 07:06:27 +00:00
Makefile Improve the glimpse target: don't index .svn and compile directories. 2008-08-15 14:11:30 +00:00