[PATCH] mm: swap write failure fixup
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Tue, 26 Sep 2006 06:31:26 +0000 (23:31 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 26 Sep 2006 15:48:48 +0000 (08:48 -0700)
commit6ddab3b9ebebc88bfdd8107c64f12d7e4480c559
tree192edd3a85d3665bb7e44c429609a7357ba12bac
parentca5f9703dffa012cc46166e6206c5a992910e041
[PATCH] mm: swap write failure fixup

Currently we can silently drop data if the write to swap failed.  It
usually doesn't result in data-corruption because on page-in the process
will receive SIGBUS (assuming write-failure implies read-failure).

This assumption might or might not be valid.

This patch will avoid the page being discarded after a failed write.  But
will print a warning the sysadmin _should_ take to heart, if a lot of swap
space becomes un-writeable, OOM is not far off.

Tested by making the write fail 'randomly' once every 50 writes or so.

[akpm@osdl.org: printk warning fix]
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
mm/page_io.c