No, not this way, I'm afraid. Sorry, I don't remember the prior
discussion on LKML, must have flooded past when my attention was
elsewhere.
I think you were cc'd on some of it but you never commented. Anyhow,
I've reworked this patch series based on your comments. The hints were
appreciated, thanks. This was the way I'd originally hoped to be able to
work things, I just couldn't find the right way to do it.
Is it worth doing this at all? Probably, but I've no experience
whatsoever of swap write errors, so it's hard for me to judge: my
guess is that many cases would turn out to be software errors (e.g.
lower level needing more memory to perform the write). But you'd
be right to counter: let's assume they're hardware errors, and
then fix up any software errors when reported.
I have a swap block driver where hardware write errors are more likely
and hence have a need to handle them more gracefully than IO loops. It
seems like a good idea to avoid the IO loops anyway.
If it is worth doing this, then you'll need to add code to write
back the swap header, to note the bad pages permanently: you may
well have been waiting to see what reception the patches so far
get, before embarking on that.
You can't proceed to do that until you're able to identify the bad pages
so this would be a necessary first step towards that, yes.