]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix at least one source of the continued 'NFS append race'. close()
authordillon <dillon@FreeBSD.org>
Wed, 5 Jan 2000 00:32:18 +0000 (00:32 +0000)
committerdillon <dillon@FreeBSD.org>
Wed, 5 Jan 2000 00:32:18 +0000 (00:32 +0000)
commit42026f70c270b564f3855d44f7a6bc01c797bd1c
tree5cd9e009d8c0352b18f28a3e837bcd65aabfb689
parent6beb973de0a783c029d23ae0ab672a129aea4a5f
Fix at least one source of the continued 'NFS append race'.  close()
    was calling nfs_flush() and then clearing the NMODIFIED bit.  This is
    not legal since there might still be dirty buffers after the nfs_flush
    (for example, pending commits).  The clearing of this bit in turn prevented
    a necessary vinvalbuf() from occuring leaving left over dirty buffers
    even after truncating the file in a new operation.  The fix is to
    simply not clear NMODIFIED.

    Also added a sysctl vfs.nfs.nfsv3_commit_on_close which, if set to 1,
    will cause close() to do a stage 1 write AND a stage 2 commit
    synchronously.  By default only the stage 1 write is done synchronously.

Reviewed by: Alfred Perlstein <bright@wintelcom.net>
sys/nfs/nfs_vnops.c
sys/nfsclient/nfs_vnops.c