libceph: don't require r_num_pages for bio requests
authorAlex Elder <elder@inktank.com>
Thu, 31 Jan 2013 22:02:00 +0000 (16:02 -0600)
committerSage Weil <sage@inktank.com>
Thu, 14 Feb 2013 02:29:11 +0000 (18:29 -0800)
commit9cbb1d7268afa997a7f96d779470cc57d28e1a13
tree573dfaa8590be939671c73d3536fe031094d1b2e
parent1e32d34cfa6759df58b5f4002664241f2a0fef6a
libceph: don't require r_num_pages for bio requests

There is a check in the completion path for osd requests that
ensures the number of pages allocated is enough to hold the amount
of incoming data expected.

For bio requests coming from rbd the "number of pages" is not really
meaningful (although total length would be).  So stop requiring that
nr_pages be supplied for bio requests.  This is done by checking
whether the pages pointer is null before checking the value of
nr_pages.

Note that this value is passed on to the messenger, but there it's
only used for debugging--it's never used for validation.

While here, change another spot that used r_pages in a debug message
inappropriately, and also invalidate the r_con_filling_msg pointer
after dropping a reference to it.

This resolves:
    http://tracker.ceph.com/issues/3875

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
drivers/block/rbd.c
net/ceph/osd_client.c