[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: [netbsd-5] src/sys/fs/puffs
Module Name: src
Committed By: bouyer
Date: Sat Sep 17 18:53:30 UTC 2011
src/sys/fs/puffs [netbsd-5]: puffs_node.c puffs_sys.h puffs_vnops.c
Pull up following revision(s) (requested by manu in ticket #1666):
sys/fs/puffs/puffs_sys.h: revision 1.78 via patch
sys/fs/puffs/puffs_node.c: revision 1.20 via patch
sys/fs/puffs/puffs_vnops.c: revision 1.155 via patch
Add a mutex for operations that touch size (setattr, getattr, write, fsync).
This is required to avoid data corruption bugs, where a getattr slices
itself within a setattr operation, and sets the size to the stall value
it got from the filesystem. That value is smaller than the one set by
setattr, and the call to uvm_vnp_setsize() trigged a spurious truncate.
The result is a chunk of zeroed data in the file.
Such a situation can easily happen when the ioflush thread issue a
VOP_FSYNC/puffs_vnop_sync/flushvncache/dosetattrn while andother process
do a sys_stat/VOP_GETATTR/puffs_vnop_getattr.
This mutex on size operation can be removed the day we decide VOP_GETATTR
has to operated on a locked vnode, since the other operations that touch
size already require that.
To generate a diff of this commit:
cvs rdiff -u -r126.96.36.199 -r188.8.131.52 src/sys/fs/puffs/puffs_node.c
cvs rdiff -u -r184.108.40.206 -r220.127.116.11 src/sys/fs/puffs/puffs_sys.h
cvs rdiff -u -r18.104.22.168 -r22.214.171.124 src/sys/fs/puffs/puffs_vnops.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Main Index |
Thread Index |