]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:45:54 +0000 (19:45 -0600)
commitf8d278b955660fdc715f91ebb5a15b6f8d759a78
tree2afdf4d960f1504d12b0daea73932cf142448694
parentbb3d317ce7265ea7e990c95ba1f6f23169a9c3e7
block, bfq: return nbytes and not zero from struct cftype .write() method

BugLink: https://bugs.launchpad.net/bugs/1835972
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
block/bfq-cgroup.c