Source-Changes archive

[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

Modified Files:
        src/sys/fs/puffs [netbsd-5]: puffs_node.c puffs_sys.h puffs_vnops.c

Log Message:
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 -r1.13.10.1 -r1.13.10.2 src/sys/fs/puffs/puffs_node.c
cvs rdiff -u -r1.70.20.2 -r1.70.20.3 src/sys/fs/puffs/puffs_sys.h
cvs rdiff -u -r1.129.4.9 -r1.129.4.10 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.

Home | Main Index | Thread Index | Old Index