]> git.baikalelectronics.ru Git - kernel.git/commit
block, bfq: return nbytes and not zero from struct cftype .write() method
authorMaciej S. Szmigiero <mail@maciej.szmigiero.name>
Wed, 15 Aug 2018 21:56:45 +0000 (23:56 +0200)
committerJens Axboe <axboe@kernel.dk>
Thu, 16 Aug 2018 19:11:16 +0000 (13:11 -0600)
commitb4989bc2230d49dea1a4449299b1638c271036a9
tree7233047c8a5d8c0925d62b9a59235c73996f0931
parent120c4424016b7c66f44e6299473a14ff73daefab
block, bfq: return nbytes and not zero from struct cftype .write() method

The value that struct cftype .write() method returns is then directly
returned to userspace as the value returned by write() syscall, so it
should be the number of bytes actually written (or consumed) and not zero.

Returning zero from write() syscall makes programs like /bin/echo or bash
spin.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Fixes: 858a4b9e2056 ("block, bfq: add full hierarchical scheduling and cgroups support")
Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bfq-cgroup.c