relay: fix "full buffer with exactly full last subbuffer" accounting problem
relay: fix "full buffer with exactly full last subbuffer" accounting problem

In relay's current read implementation, if the buffer is completely full
but hasn't triggered the buffer-full condition (i.e. the last write
didn't cross the subbuffer boundary) and the last subbuffer is exactly
full, the subbuffer accounting code erroneously finds nothing available.
This patch fixes the problem.

Signed-off-by: Tom Zanussi <ca42f6846873622f2a6dc51a5106ba83ffbdaf95@gmail.com>
Cc: Eduard - Gabriel Munteanu <9ef905a2d38b38aa7dfda4d9b84ab0b6430a67f0@linux360.ro>
Cc: Pekka Enberg <add4fcd06328a394f0ad91feda7ee057316dc5ed@cs.helsinki.fi>
Cc: Jens Axboe <165ab144a3ccfd9429d5c6466b275f24fafdb114@oracle.com>
Cc: Mathieu Desnoyers <190d869914867af3324e655624a7a9648976ce81@krystal.dyndns.org>
Cc: Andrea Righi <243bc7e273657b4ad9a7ca12a3b3ad7b5bb1c892@gmail.com>
Cc: <4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@kernel.org>		[2.6.25.x, 2.6.26.x]
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>

KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas