tcmu: fix free block calculation
authorMike Christie <mchristi@redhat.com>
Tue, 28 Nov 2017 18:40:35 +0000 (12:40 -0600)
committerNicholas Bellinger <nab@linux-iscsi.org>
Fri, 12 Jan 2018 23:07:16 +0000 (15:07 -0800)
commit3c0f26ff9d040c6193b33689bbc03103854dba4d
treec0297332b86f96377f21745e40668c33710c5bfd
parent1a1fc0b88e9019cb3b2f291bdcb2d03d38614690
tcmu: fix free block calculation

The blocks_left calculation does not account for free blocks
between 0 and thresh, so we could be queueing/waiting when
there are enough blocks free.

This has us add in the blocks between 0 and thresh as well as
at the end from thresh to DATA_BLOCK_BITS.

Signed-off-by: Mike Christie <mchristi@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_user.c