Tang Junhui
c4c9fd5589
bcache: return attach error when no cache set exist
...
[ Upstream commit 7f4fc93d47 ]
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 >
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-04-26 11:02:18 +02:00
..
2018-04-26 11:02:18 +02:00
2018-01-23 19:58:18 +01:00
2017-12-17 15:08:00 +01:00
2017-11-02 11:10:55 +01:00
2017-06-19 11:03:50 -04:00
2017-06-09 09:27:32 -06:00
2017-06-19 11:03:50 -04:00
2017-03-07 11:30:16 -05:00
2017-08-23 12:49:55 -06:00
2018-03-15 10:54:33 +01:00
2017-08-28 11:47:17 -04:00
2017-11-02 11:10:55 +01:00
2017-05-17 09:44:53 -04:00
2017-03-07 13:28:31 -05:00
2016-12-16 00:13:41 +02:00
2017-05-05 14:40:13 -04:00
2017-03-07 13:28:31 -05:00
2017-03-07 13:28:31 -05:00
2017-05-14 21:54:33 -04:00
2014-01-16 13:44:11 -05:00
2017-03-07 13:28:31 -05:00
2017-12-20 10:10:21 +01:00
2017-11-30 08:40:43 +00:00
2018-04-24 09:36:31 +02:00
2017-08-23 12:49:55 -06:00
2017-08-23 12:49:55 -06:00
2015-11-04 21:19:53 -08:00
2016-01-08 20:03:05 -05:00
2017-09-14 13:43:16 -07:00
2018-01-23 19:58:19 +01:00
2017-08-23 12:49:55 -06:00
2017-09-25 11:18:29 -04:00
2017-06-19 11:03:51 -04:00
2017-09-14 13:43:16 -07:00
2015-10-31 19:06:00 -04:00
2015-04-15 12:10:20 -04:00
2009-09-04 20:40:34 +01:00
2017-09-14 13:43:16 -07:00
2016-11-01 09:43:26 -06:00
2018-04-26 11:02:07 +02:00
2008-10-10 13:36:58 +01:00
2011-10-31 19:31:18 -04:00
2016-02-22 22:34:42 -05:00
2016-02-22 22:34:42 -05:00
2017-08-23 12:49:55 -06:00
2018-03-19 08:42:54 +01:00
2016-08-07 14:41:02 -06:00
2017-02-17 00:54:09 -05:00
2017-08-28 10:23:28 -04:00
2017-08-28 10:23:28 -04:00
2016-02-22 22:34:42 -05:00
2017-05-31 10:50:23 -04:00
2016-01-08 20:03:05 -05:00
2017-12-20 10:10:21 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-09-14 13:43:16 -07:00
2017-09-14 13:43:16 -07:00
2016-06-10 15:15:44 -04:00
2017-11-30 08:40:43 +00:00
2017-06-09 09:27:32 -06:00
2018-01-23 19:58:18 +01:00
2016-07-20 12:43:35 -04:00
2017-12-20 10:10:21 +01:00
2011-10-31 19:31:19 -04:00
2007-10-20 02:01:26 +01:00
2017-07-26 15:55:44 -04:00
2017-03-16 09:37:31 -04:00
2017-09-14 13:43:16 -07:00
2017-04-24 15:37:04 -04:00
2017-06-09 09:27:32 -06:00
2017-08-23 12:49:55 -06:00
2017-07-26 15:55:43 -04:00
2017-11-30 08:40:42 +00:00
2017-06-19 11:05:20 -04:00
2018-02-22 15:42:29 +01:00
2017-04-27 17:08:44 -04:00
2017-08-23 12:49:55 -06:00
2017-06-19 11:05:20 -04:00
2017-08-23 12:49:55 -06:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-05-21 20:37:09 -07:00
2017-11-02 11:10:55 +01:00
2018-03-08 22:41:26 -08:00
2017-09-27 20:07:40 -07:00
2017-08-23 12:49:55 -06:00
2017-11-02 11:10:55 +01:00
2017-09-07 12:41:48 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-02-25 11:07:57 +01:00
2017-11-02 11:10:55 +01:00
2017-12-14 09:52:59 +01:00
2017-11-02 11:10:55 +01:00
2017-12-20 10:10:36 +01:00
2018-02-25 11:07:57 +01:00
2017-11-02 11:10:55 +01:00
2018-02-25 11:07:57 +01:00
2017-11-02 11:10:55 +01:00