libtcmu: fix mode sense handling
libtcmu: fix mode sense handling

This patch fixes the following bugs in the mode sense code.

1. If the ALLOCATION LENGTH could not hold all the data we wanted
to return we would always return ILLEGAL REQUEST.

2. For 0x3f case, we would return error if we were executing a
MODE_SENSE_10 and the data we were going to return would be
255 or more. We meant to do this for MODE_SENSE_6 like is
done for the non 0x3f case

3. If our internal temp buffer was too small we would return
ILLEGAL REQUEST. We probably want to return HARDWARE_ERROR.

Signed-off-by: Mike Christie <39daeb1549a929782e38aa87c4e3da7f3844b09a@redhat.com>

open-iscsi/tcmu-runner,agrover/tcmu-runner,open-iscsi/tcmu-runner