cvs commit: src/sys/vm vm_map.c src/sys/vfs/ufs ufs_readwrite.c
Matthew Dillon
dillon at crater.dragonflybsd.org
Thu Apr 22 23:23:59 PDT 2004
dillon 2004/04/22 23:23:46 PDT
DragonFly src repository
Modified files:
sys/vm vm_map.c
sys/vfs/ufs ufs_readwrite.c
Log:
msync(..., MS_INVALIDATE) will incorrectly remove dirty pages without
synchronizing them to their backing store under certain circumstances,
and can also cause struct buf's to become inconsistent. This can be
particularly gruesome when MS_INVALIDATE is used on a range of memory that
is mmap()'d to be read-only.
Fix MS_INVALIDATE's operation (1) by making UFS honor the invalidation
request when flushing to backing store to destroy the related struct buf
and (2) by never removing pages wired into the buffer cache and never
removing pages that are found to still be dirty.
Note that NFS was already coded to honor invalidation requests in
nfs_write(). Filesystems other then NFS and UFS do not currently support
buffer-invalidation-on-write but all that means now is that the pages
will remain in cache, rather then be incorrectly removed and cause corruption.
Reported-by: Stephan Uphoff <ups at xxxxxxxx>, Julian Elischer <julian at xxxxxxxxxxxx>
Revision Changes Path
1.25 +1 -1 src/sys/vm/vm_map.c
1.10 +2 -0 src/sys/vfs/ufs/ufs_readwrite.c
http://www.dragonflybsd.org/cvsweb/src/sys/vm/vm_map.c.diff?r1=1.24&r2=1.25&f=h
http://www.dragonflybsd.org/cvsweb/src/sys/vfs/ufs/ufs_readwrite.c.diff?r1=1.9&r2=1.10&f=h
More information about the Commits
mailing list