]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 9 Sep 2018 17:55:59 +0000 (19:55 +0200)
commited480f2b9e86102b5d57fcd708915ae4f34add5b
treeaf5b98b3afd1f49ac55b99d88e3a4a3a87856775
parentfe806eb54bca42f854e2b74a08ebbba5a860f473
block, bfq: return nbytes and not zero from struct cftype .write() method

commit fc8ebd01deeb12728c83381f6ec923e4a192ffd3 upstream.

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: e21b7a0b9887 ("block, bfq: add full hierarchical scheduling and cgroups support")
Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
block/bfq-cgroup.c