diff options
author | kib <kib@FreeBSD.org> | 2009-01-20 11:27:45 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2009-01-20 11:27:45 +0000 |
commit | cbb8defa10711f9b65be83f41f04cbabab84b5fc (patch) | |
tree | 5eb98cf0aa27fc9b58d32f9acd64320401f90a15 /sys/kern/vfs_subr.c | |
parent | 7620a1118d5a4aa8aea748887ebdb85925c467c1 (diff) | |
download | FreeBSD-src-cbb8defa10711f9b65be83f41f04cbabab84b5fc.zip FreeBSD-src-cbb8defa10711f9b65be83f41f04cbabab84b5fc.tar.gz |
FFS puts the extended attributes blocks at the negative blocks for the
vnode, from -1 down. When vinvalbuf(vp, V_ALT) is done for the vnode, it
incorrectly does vm_object_page_remove(0, 0), removing all pages from
the underlying vm object, not only the pages that back the extended
attributes data.
Change vinvalbuf() to not remove any pages from the object when
V_NORMAL or V_ALT are specified. Instead, the only in-tree caller
in ffs_inode.c:ffs_truncate() that specifies V_ALT explicitely
removes the corresponding page range. The V_NORMAL caller
does vnode_pager_setsize(vp, 0) immediately after the call to
vinvalbuf(V_NORMAL) already.
Reported by: csjp
Reviewed by: ups
MFC after: 3 weeks
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r-- | sys/kern/vfs_subr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index eb02693..1e4bf90 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1156,7 +1156,7 @@ bufobj_invalbuf(struct bufobj *bo, int flags, int slpflag, int slptimeo) /* * Destroy the copy in the VM cache, too. */ - if (bo->bo_object != NULL) { + if (bo->bo_object != NULL && (flags & (V_ALT | V_NORMAL)) == 0) { VM_OBJECT_LOCK(bo->bo_object); vm_object_page_remove(bo->bo_object, 0, 0, (flags & V_SAVE) ? TRUE : FALSE); |