1.1 --- a/libfsserver/lib/mapping/page_mapper.cc Fri May 20 00:40:27 2022 +0200
1.2 +++ b/libfsserver/lib/mapping/page_mapper.cc Fri May 20 22:54:36 2022 +0200
1.3 @@ -162,11 +162,31 @@
1.4 {
1.5 if (flexpage->decrement() || purge)
1.6 {
1.7 + /* NOTE: Derived flexpages might potentially support their contents
1.8 + being merged into the flushed data, although this is a
1.9 + non-trivial problem. */
1.10 +
1.11 if (flexpage->modified())
1.12 _accessor->flush(flexpage);
1.13
1.14 + /* Unmap the flexpage, requiring users of its memory to request another
1.15 + flexpage in future. */
1.16 +
1.17 ipc_unmap_flexpage(flexpage);
1.18 flexpage->invalidate();
1.19 +
1.20 + /* Unmap all derived flexpages, since these rely on the underlying file
1.21 + contents. */
1.22 +
1.23 + DerivedFlexpages::iterator it;
1.24 +
1.25 + for (it = flexpage->derived.begin(); it != flexpage->derived.end(); it++)
1.26 + {
1.27 + ipc_unmap_flexpage(*it);
1.28 + (*it)->invalidate();
1.29 + }
1.30 +
1.31 + flexpage->disassociate();
1.32 }
1.33 }
1.34