diff options
author | Tang Junhui | 2018-02-07 11:41:45 -0800 |
---|---|---|
committer | Jens Axboe | 2018-02-07 12:50:01 -0700 |
commit | 7f4fc93d4713394ee8f1cd44c238e046e11b4f15 (patch) | |
tree | 335e2ce8e0eb29e7b21878dea04d9c3472eaa9b2 /LICENSES | |
parent | 7a5e3ecbe5b7b58e9a78a3738b28244982822e1c (diff) |
bcache: return attach error when no cache set exist
I attach a back-end device to a cache set, and the cache set is not
registered yet, this back-end device did not attach successfully, and no
error returned:
[root]# echo 87859280-fec6-4bcc-20df7ca8f86b > /sys/block/sde/bcache/attach
[root]#
In sysfs_attach(), the return value "v" is initialized to "size" in
the beginning, and if no cache set exist in bch_cache_sets, the "v" value
would not change any more, and return to sysfs, sysfs regard it as success
since the "size" is a positive number.
This patch fixes this issue by assigning "v" with "-ENOENT" in the
initialization.
Signed-off-by: Tang Junhui <tang.junhui@zte.com.cn>
Reviewed-by: Michael Lyle <mlyle@lyle.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'LICENSES')
0 files changed, 0 insertions, 0 deletions