summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Pierre André <jpandre@users.sourceforge.net>2012-08-22 10:00:23 +0200
committerJean-Pierre André <jpandre@users.sourceforge.net>2012-08-22 10:00:23 +0200
commit2d01280099a10c1d188763a93be0743aa06427d8 (patch)
tree30d1cb106ae7f8cb9f865068386197bc0195e55d
parentc660e362b27b57c42b3c399c0df59ee1e8cda7a3 (diff)
downloadillumos-fusefs-2d01280099a10c1d188763a93be0743aa06427d8.tar.gz
Fixed invalidating cached pages beyond a truncation
-rw-r--r--kernel/fuse_vnops.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/fuse_vnops.c b/kernel/fuse_vnops.c
index 347ba6b..5824218 100644
--- a/kernel/fuse_vnops.c
+++ b/kernel/fuse_vnops.c
@@ -1595,6 +1595,18 @@ fuse_setattr(
if (mask & AT_NOSET)
return (EINVAL);
+ if (mask & AT_SIZE) {
+ /*
+ * Mark all pages beyond the truncation as invalid
+ * otherwise old data may show in holes which
+ * are left in rewritten parts.
+ * Actually we cannot find pages beyond the
+ * truncation, so we invalidate them all.
+ */
+ if (vn_has_cached_data(vp))
+ pvn_vplist_dirty(vp, 0, fuse_putapage, B_INVAL, credp);
+ }
+
mutex_enter(&VTOFD(vp)->f_lock);
if (err = VOP_GETATTR(vp, &va, flags, credp, ct))