mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 18:39:59 +00:00
block, bfq: return nbytes and not zero from struct cftype .write() method
commitfc8ebd01de
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:e21b7a0b98
("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>
This commit is contained in:
parent
fe806eb54b
commit
ed480f2b9e
1 changed files with 2 additions and 1 deletions
|
@ -887,7 +887,8 @@ static ssize_t bfq_io_set_weight(struct kernfs_open_file *of,
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
return bfq_io_set_weight_legacy(of_css(of), NULL, weight);
|
||||
ret = bfq_io_set_weight_legacy(of_css(of), NULL, weight);
|
||||
return ret ?: nbytes;
|
||||
}
|
||||
|
||||
static int bfqg_print_stat(struct seq_file *sf, void *v)
|
||||
|
|
Loading…
Reference in a new issue