mm: add comment on swap_duplicate's error code
authorHugh Dickins <hugh.dickins@tiscali.co.uk>
Fri, 5 Mar 2010 21:42:25 +0000 (13:42 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 6 Mar 2010 19:26:27 +0000 (11:26 -0800)
commit08259d58e4fa12ceaece82193c5816152f638cca
tree8c032914139c5aec362a73b8316cf81f020f9f8f
parentc08c6e1f54c85fc299cf9f88cf330d6dd28a9a1d
mm: add comment on swap_duplicate's error code

swap_duplicate()'s loop appears to miss out on returning the error code
from __swap_duplicate(), except when that's -ENOMEM.  In fact this is
intentional: prior to -ENOMEM for swap_count_continuation,
swap_duplicate() was void (and the case only occurs when copy_one_pte()
hits a corrupt pte).  But that's surprising behaviour, which certainly
deserves a comment.

Signed-off-by: Hugh Dickins <hughd@google.com>
Reported-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/swapfile.c