aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaciej S. Szmigiero <mail@maciej.szmigiero.name>2018-08-15 17:56:45 -0400
committerJens Axboe <axboe@kernel.dk>2018-08-16 15:11:16 -0400
commitfc8ebd01deeb12728c83381f6ec923e4a192ffd3 (patch)
tree7233047c8a5d8c0925d62b9a59235c73996f0931
parentf812164869b98d81d692ce12bfed76621a5c8908 (diff)
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: e21b7a0b9887 ("block, bfq: add full hierarchical scheduling and cgroups support") Cc: stable@vger.kernel.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--block/bfq-cgroup.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/bfq-cgroup.c b/block/bfq-cgroup.c
index a9e8633388f4..58c6efa9f9a9 100644
--- a/block/bfq-cgroup.c
+++ b/block/bfq-cgroup.c
@@ -913,7 +913,8 @@ static ssize_t bfq_io_set_weight(struct kernfs_open_file *of,
913 if (ret) 913 if (ret)
914 return ret; 914 return ret;
915 915
916 return bfq_io_set_weight_legacy(of_css(of), NULL, weight); 916 ret = bfq_io_set_weight_legacy(of_css(of), NULL, weight);
917 return ret ?: nbytes;
917} 918}
918 919
919#ifdef CONFIG_DEBUG_BLK_CGROUP 920#ifdef CONFIG_DEBUG_BLK_CGROUP