summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Pierre André <jpandre@users.sourceforge.net>2012-08-22 10:00:22 +0200
committerJean-Pierre André <jpandre@users.sourceforge.net>2012-08-22 10:00:22 +0200
commita44a53d305769ddd979fb84e68a6e74db841a8d4 (patch)
treee9d012000383a14f719929feaa514b2f837bdedb
parentef3fffe827e50c9885c80cdce10f66eba651d2af (diff)
downloadillumos-fusefs-a44a53d305769ddd979fb84e68a6e74db841a8d4.tar.gz
Invalidate cached pages when deleting a file (avoiding memory leak)
-rw-r--r--kernel/fuse_vnops.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/fuse_vnops.c b/kernel/fuse_vnops.c
index 1298d1c..f58587f 100644
--- a/kernel/fuse_vnops.c
+++ b/kernel/fuse_vnops.c
@@ -2985,6 +2985,11 @@ fuse_vnode_free(struct vnode *vp, fuse_session_t *sep)
struct fuse_vnode_data *fvdatap = VTOFD(vp);
if (VTOFD(vp)) {
+ /* Invalidate cached pages */
+ if (vn_has_cached_data(vp)) {
+ pvn_vplist_dirty(vp, 0, fuse_putapage,
+ B_INVAL, sep->usercred);
+ }
mutex_enter(&fvdatap->fh_list_lock);
for (fhp = list_head(&fvdatap->fh_list); fhp;
fhp = list_next(&fvdatap->fh_list, fhp)) {