libceph: don't bail early from try_read() when skipping a message
authorIlya Dryomov <idryomov@gmail.com>
Wed, 17 Feb 2016 19:04:08 +0000 (20:04 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Wed, 24 Feb 2016 19:28:31 +0000 (20:28 +0100)
commite7a88e82fe380459b864e05b372638aeacb0f52d
tree5ac73053add9decef9f5ec7fc6d769e1bb6672d8
parent81f70ba233d5f660e1ea5fe23260ee323af5d53a
libceph: don't bail early from try_read() when skipping a message

The contract between try_read() and try_write() is that when called
each processes as much data as possible.  When instructed by osd_client
to skip a message, try_read() is violating this contract by returning
after receiving and discarding a single message instead of checking for
more.  try_write() then gets a chance to write out more requests,
generating more replies/skips for try_read() to handle, forcing the
messenger into a starvation loop.

Cc: stable@vger.kernel.org # 3.10+
Reported-by: Varada Kari <Varada.Kari@sandisk.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Tested-by: Varada Kari <Varada.Kari@sandisk.com>
Reviewed-by: Alex Elder <elder@linaro.org>
net/ceph/messenger.c