Skip to contentSkip to conversation

mm/frontswap: add missing handle on a dup-store failure

PATCH In review Weijie Yang 1 participant 1 message Jan 27, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 8/8 mm/frontswap: add missing handle on a dup-store failure

If a frontswap dup-store failed, it should invalidate the old page in backend and return failure.

This patch add this missing handle. According to the comments of __frontswap_store(), it should have been there.

---
 mm/frontswap.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
mm/frontswap.c +3 -1
index df067f1..171c6c0 100644
@@ -245,8 +245,10 @@ int __frontswap_store(struct page *page)
 		  the (older) page from frontswap
 		 */
 		inc_frontswap_failed_stores();
-		if (dup)
+		if (dup) {
 			__frontswap_clear(sis, offset);
+			frontswap_ops->invalidate_page(type, offset);
+		}
 	}
 	if (frontswap_writethrough_enabled)
 		/* report failure so swap also writes to swap device */
Signature · 1 line
1.7.10.4