rmacklem 13e7ae9b12 A problem with the old NFS client where large writes to large files
would sometimes result in a corrupted file was reported via email.
This problem appears to have been caused by r251719 (reverting
r251719 fixed the problem). Although I have not been able to
reproduce this problem, I suspect it is caused by another thread
increasing np->n_size after the mtx_unlock(&np->n_mtx) but before
the vnode_pager_setsize() call. Since the np->n_mtx mutex serializes
updates to np->n_size, doing the vnode_pager_setsize() with the
mutex locked appears to avoid the problem.
Unfortunately, vnode_pager_setsize() where the new size is smaller,
cannot be called with a mutex held.
This patch returns the semantics to be close to pre-r251719 such that the
call to the vnode_pager_setsize() is only delayed until after the mutex is
unlocked when np->n_size is shrinking. Since the file is growing
when being written, I believe this will fix the corruption.

Reported by:	David G. Lawrence (dg@dglawrence.com)
Tested by:	David G. Lawrence (pending, to happen soon)
Reviewed by:	kib
MFC after:	1 week
2013-07-04 00:54:23 +00:00
..
2013-06-08 13:30:13 +00:00
2013-07-03 10:31:45 +00:00
2013-07-03 07:31:07 +00:00
2013-05-12 16:43:26 +00:00
2013-07-03 18:48:43 +00:00
2013-06-01 12:21:59 +00:00
2013-04-17 11:45:15 +00:00
2013-07-02 07:17:56 +00:00
2013-06-18 06:55:58 +00:00