Commit 0ec1d15e authored by Ilya Dryomov's avatar Ilya Dryomov Committed by Sage Weil

libceph: do not dereference a NULL bio pointer

Commit f38a5181 ("ceph: Convert to immutable biovecs") introduced
a NULL pointer dereference, which broke rbd in -rc1.  Fix it.

Cc: Kent Overstreet <kmo@daterainc.com>
Signed-off-by: default avatarIlya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: default avatarSage Weil <sage@inktank.com>
parent ff513ace
......@@ -840,9 +840,13 @@ static bool ceph_msg_data_bio_advance(struct ceph_msg_data_cursor *cursor,
if (!cursor->bvec_iter.bi_size) {
bio = bio->bi_next;
cursor->bvec_iter = bio->bi_iter;
cursor->bio = bio;
if (bio)
cursor->bvec_iter = bio->bi_iter;
else
memset(&cursor->bvec_iter, 0,
sizeof(cursor->bvec_iter));
}
cursor->bio = bio;
if (!cursor->last_piece) {
BUG_ON(!cursor->resid);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment