]> git.karo-electronics.de Git - karo-tx-linux.git/commit
libceph: (re)initialize bio_iter on start of message receive
authorSage Weil <sage@inktank.com>
Mon, 30 Jul 2012 23:20:25 +0000 (16:20 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Nov 2012 19:38:39 +0000 (11:38 -0800)
commit175c4c20d29322b9e882c052025e72644ca00e2d
treea146aa8afa8ac1560ed5350c11bda105e95ea274
parentd43841ef768a78f2cbc7e819f1a2838a4838f566
libceph: (re)initialize bio_iter on start of message receive

(cherry picked from commit a4107026976f06c9a6ce8cc84a763564ee39d901)

Previously, we were opportunistically initializing the bio_iter if it
appeared to be uninitialized in the middle of the read path.  The problem
is that a sequence like:

 - start reading message
 - initialize bio_iter
 - read half a message
 - messenger fault, reconnect
 - restart reading message
 - ** bio_iter now non-NULL, not reinitialized **
 - read past end of bio, crash

Instead, initialize the bio_iter unconditionally when we allocate/claim
the message for read.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Alex Elder <elder@inktank.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ceph/messenger.c