2013-04-30 00:44:33 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2011-03-21 15:10:11 -07:00
|
|
|
|
2013-05-01 12:43:03 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-13 17:20:04 +01:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2013-05-01 12:43:03 -05:00
|
|
|
|
2013-12-13 15:28:57 +02:00
|
|
|
|
2014-08-04 18:04:39 +04:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-06 16:00:54 -05:00
|
|
|
|
|
|
|
|
|
2012-02-07 12:03:37 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-08 22:50:04 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-01-29 13:57:44 -06:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-12-16 19:26:32 +02:00
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2015-10-11 19:38:00 +02:00
|
|
|
|
|
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
|
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
|
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
2012-07-10 20:30:11 -05:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
2016-08-12 16:11:41 +02:00
|
|
|
|
|
|
|
|
|
2012-10-09 13:50:17 -07:00
|
|
|
|
|
|
|
|
|
2017-03-02 19:56:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-16 15:41:54 +01:00
|
|
|
|
2017-03-02 19:56:57 +01:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:22 +01:00
|
|
|
|
2018-01-16 15:41:54 +01:00
|
|
|
|
|
|
|
|
|
2012-10-09 13:50:17 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:40 -05:00
|
|
|
|
2012-10-09 13:50:17 -07:00
|
|
|
|
2012-02-02 08:13:30 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
2012-07-09 21:04:24 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:22 +01:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2012-08-31 17:29:51 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
|
|
|
|
|
2011-03-21 15:10:11 -07:00
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-01 08:39:26 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-26 09:43:47 -05:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2013-04-26 09:43:47 -05:00
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
|
|
|
|
|
2013-04-26 09:43:47 -05:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2012-01-29 13:57:44 -06:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-18 12:31:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2014-03-13 11:21:35 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-01 22:22:16 +08:00
|
|
|
|
2014-03-13 11:21:35 +08:00
|
|
|
|
|
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2017-01-25 18:16:23 +01:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-17 12:25:27 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2013-05-10 16:29:22 -05:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-25 16:11:12 -08:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-08 09:55:49 -06:00
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
|
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
2014-04-01 22:22:16 +08:00
|
|
|
|
2013-02-08 09:55:49 -06:00
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-08 09:55:49 -06:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2013-05-10 16:29:22 -05:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-10 12:34:25 -05:00
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-08 09:55:48 -06:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2013-02-08 09:55:48 -06:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2013-02-08 09:55:48 -06:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2016-08-12 16:11:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-31 17:29:51 -05:00
|
|
|
|
2012-08-30 14:42:15 -05:00
|
|
|
|
2012-07-13 20:35:12 -05:00
|
|
|
|
2012-08-31 17:29:51 -05:00
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2013-12-13 15:28:57 +02:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2012-07-10 20:30:11 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-14 12:43:31 -06:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2013-01-14 12:43:31 -06:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2015-06-22 13:24:48 +03:00
|
|
|
|
2016-08-18 18:38:45 +02:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2016-04-29 20:01:25 +02:00
|
|
|
|
2016-05-26 01:15:02 +02:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2016-08-12 15:45:52 +02:00
|
|
|
|
2012-11-14 12:25:19 -06:00
|
|
|
|
2016-08-12 16:11:41 +02:00
|
|
|
|
|
|
|
|
|
2016-05-26 01:15:02 +02:00
|
|
|
|
2016-08-12 16:11:41 +02:00
|
|
|
|
|
|
|
|
|
2011-03-21 15:10:11 -07:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
2017-04-13 12:17:38 +02:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-12 15:45:52 +02:00
|
|
|
|
2011-03-21 15:10:11 -07:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
|
|
|
|
|
2013-05-08 22:50:04 -05:00
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2015-01-13 17:20:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-11-21 17:11:12 -08:00
|
|
|
|
|
|
|
|
|
2012-08-31 17:29:51 -05:00
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-14 12:43:31 -06:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
|
|
|
|
|
2013-01-14 12:43:31 -06:00
|
|
|
|
2016-09-29 13:41:05 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-14 12:43:31 -06:00
|
|
|
|
2013-01-14 12:43:31 -06:00
|
|
|
|
|
|
|
|
|
2013-01-14 12:43:31 -06:00
|
|
|
|
2016-09-29 13:41:05 +02:00
|
|
|
|
2013-01-14 12:43:31 -06:00
|
|
|
|
|
|
|
|
|
2013-05-31 17:40:45 -05:00
|
|
|
|
2012-01-29 13:57:44 -06:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2012-01-29 13:57:44 -06:00
|
|
|
|
|
|
|
|
|
2012-01-29 13:57:44 -06:00
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-05-01 12:43:04 -05:00
|
|
|
|
|
|
|
|
|
2013-05-01 12:43:03 -05:00
|
|
|
|
2013-05-01 12:43:03 -05:00
|
|
|
|
2013-05-01 12:43:03 -05:00
|
|
|
|
rbd: use bio_clone_fast() instead of bio_clone()
bio_clone() makes a copy of the bi_io_vec, but rbd never changes that,
so there is no need for a copy.
bio_clone_fast() can be used instead, which avoids making the copy.
This requires that we provide a bio_set. bio_clone() uses fs_bio_set,
but it isn't, in general, safe to use the same bio_set at different
levels of the stack, as that can lead to deadlocks. As filesystems
use fs_bio_set, block devices shouldn't.
As rbd never stacks, it is safe to have a single global bio_set for
all rbd devices to use. So allocate that when the module is
initialised, and use it with bio_clone_fast().
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2017-06-18 14:38:58 +10:00
|
|
|
|
|
|
|
|
|
rbd: add support for single-major device number allocation scheme
Currently each rbd device is allocated its own major number, which
leads to a hard limit of 230-250 images mapped at once. This commit
adds support for a new single-major device number allocation scheme,
which is hidden behind a new single_major boolean module parameter and
is disabled by default for backwards compatibility reasons. (Old
userspace cannot correctly unmap images mapped under single-major
scheme and would essentially just unmap a random image, if that.)
$ rbd showmapped
id pool image snap device
0 rbd b100 - /dev/rbd0
1 rbd b101 - /dev/rbd1
2 rbd b102 - /dev/rbd2
3 rbd b103 - /dev/rbd3
Old scheme (modprobe rbd):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:24 /dev/rbd0
brw-rw---- 1 root disk 252, 0 Dec 10 12:28 /dev/rbd1
brw-rw---- 1 root disk 252, 1 Dec 10 12:28 /dev/rbd1p1
brw-rw---- 1 root disk 252, 2 Dec 10 12:28 /dev/rbd1p2
brw-rw---- 1 root disk 252, 3 Dec 10 12:28 /dev/rbd1p3
brw-rw---- 1 root disk 251, 0 Dec 10 12:28 /dev/rbd2
brw-rw---- 1 root disk 251, 1 Dec 10 12:28 /dev/rbd2p1
brw-rw---- 1 root disk 250, 0 Dec 10 12:24 /dev/rbd3
New scheme (modprobe rbd single_major=Y):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:30 /dev/rbd0
brw-rw---- 1 root disk 253, 256 Dec 10 12:30 /dev/rbd1
brw-rw---- 1 root disk 253, 257 Dec 10 12:30 /dev/rbd1p1
brw-rw---- 1 root disk 253, 258 Dec 10 12:30 /dev/rbd1p2
brw-rw---- 1 root disk 253, 259 Dec 10 12:30 /dev/rbd1p3
brw-rw---- 1 root disk 253, 512 Dec 10 12:30 /dev/rbd2
brw-rw---- 1 root disk 253, 513 Dec 10 12:30 /dev/rbd2p1
brw-rw---- 1 root disk 253, 768 Dec 10 12:30 /dev/rbd3
(major 253 was assigned dynamically at module load time)
The new limit is 4096 images mapped at once, and it comes from the fact
that, as before, 256 minor numbers are reserved for each mapping.
(A follow-up commit changes the number of minors reserved and the way
we deal with partitions over that number.)
If single_major is set to true, two new sysfs interfaces show up:
/sys/bus/rbd/{add,remove}_single_major. These are to be used instead
of /sys/bus/rbd/{add,remove}, which are disabled for backwards
compatibility reasons outlined above.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-13 15:28:57 +02:00
|
|
|
|
2013-12-13 15:28:57 +02:00
|
|
|
|
|
|
|
|
|
2014-10-09 17:06:01 +04:00
|
|
|
|
|
|
|
|
|
rbd: add support for single-major device number allocation scheme
Currently each rbd device is allocated its own major number, which
leads to a hard limit of 230-250 images mapped at once. This commit
adds support for a new single-major device number allocation scheme,
which is hidden behind a new single_major boolean module parameter and
is disabled by default for backwards compatibility reasons. (Old
userspace cannot correctly unmap images mapped under single-major
scheme and would essentially just unmap a random image, if that.)
$ rbd showmapped
id pool image snap device
0 rbd b100 - /dev/rbd0
1 rbd b101 - /dev/rbd1
2 rbd b102 - /dev/rbd2
3 rbd b103 - /dev/rbd3
Old scheme (modprobe rbd):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:24 /dev/rbd0
brw-rw---- 1 root disk 252, 0 Dec 10 12:28 /dev/rbd1
brw-rw---- 1 root disk 252, 1 Dec 10 12:28 /dev/rbd1p1
brw-rw---- 1 root disk 252, 2 Dec 10 12:28 /dev/rbd1p2
brw-rw---- 1 root disk 252, 3 Dec 10 12:28 /dev/rbd1p3
brw-rw---- 1 root disk 251, 0 Dec 10 12:28 /dev/rbd2
brw-rw---- 1 root disk 251, 1 Dec 10 12:28 /dev/rbd2p1
brw-rw---- 1 root disk 250, 0 Dec 10 12:24 /dev/rbd3
New scheme (modprobe rbd single_major=Y):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:30 /dev/rbd0
brw-rw---- 1 root disk 253, 256 Dec 10 12:30 /dev/rbd1
brw-rw---- 1 root disk 253, 257 Dec 10 12:30 /dev/rbd1p1
brw-rw---- 1 root disk 253, 258 Dec 10 12:30 /dev/rbd1p2
brw-rw---- 1 root disk 253, 259 Dec 10 12:30 /dev/rbd1p3
brw-rw---- 1 root disk 253, 512 Dec 10 12:30 /dev/rbd2
brw-rw---- 1 root disk 253, 513 Dec 10 12:30 /dev/rbd2p1
brw-rw---- 1 root disk 253, 768 Dec 10 12:30 /dev/rbd3
(major 253 was assigned dynamically at module load time)
The new limit is 4096 images mapped at once, and it comes from the fact
that, as before, 256 minor numbers are reserved for each mapping.
(A follow-up commit changes the number of minors reserved and the way
we deal with partitions over that number.)
If single_major is set to true, two new sysfs interfaces show up:
/sys/bus/rbd/{add,remove}_single_major. These are to be used instead
of /sys/bus/rbd/{add,remove}, which are disabled for backwards
compatibility reasons outlined above.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-13 15:28:57 +02:00
|
|
|
|
2017-11-13 10:35:40 +01:00
|
|
|
|
rbd: add support for single-major device number allocation scheme
Currently each rbd device is allocated its own major number, which
leads to a hard limit of 230-250 images mapped at once. This commit
adds support for a new single-major device number allocation scheme,
which is hidden behind a new single_major boolean module parameter and
is disabled by default for backwards compatibility reasons. (Old
userspace cannot correctly unmap images mapped under single-major
scheme and would essentially just unmap a random image, if that.)
$ rbd showmapped
id pool image snap device
0 rbd b100 - /dev/rbd0
1 rbd b101 - /dev/rbd1
2 rbd b102 - /dev/rbd2
3 rbd b103 - /dev/rbd3
Old scheme (modprobe rbd):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:24 /dev/rbd0
brw-rw---- 1 root disk 252, 0 Dec 10 12:28 /dev/rbd1
brw-rw---- 1 root disk 252, 1 Dec 10 12:28 /dev/rbd1p1
brw-rw---- 1 root disk 252, 2 Dec 10 12:28 /dev/rbd1p2
brw-rw---- 1 root disk 252, 3 Dec 10 12:28 /dev/rbd1p3
brw-rw---- 1 root disk 251, 0 Dec 10 12:28 /dev/rbd2
brw-rw---- 1 root disk 251, 1 Dec 10 12:28 /dev/rbd2p1
brw-rw---- 1 root disk 250, 0 Dec 10 12:24 /dev/rbd3
New scheme (modprobe rbd single_major=Y):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:30 /dev/rbd0
brw-rw---- 1 root disk 253, 256 Dec 10 12:30 /dev/rbd1
brw-rw---- 1 root disk 253, 257 Dec 10 12:30 /dev/rbd1p1
brw-rw---- 1 root disk 253, 258 Dec 10 12:30 /dev/rbd1p2
brw-rw---- 1 root disk 253, 259 Dec 10 12:30 /dev/rbd1p3
brw-rw---- 1 root disk 253, 512 Dec 10 12:30 /dev/rbd2
brw-rw---- 1 root disk 253, 513 Dec 10 12:30 /dev/rbd2p1
brw-rw---- 1 root disk 253, 768 Dec 10 12:30 /dev/rbd3
(major 253 was assigned dynamically at module load time)
The new limit is 4096 images mapped at once, and it comes from the fact
that, as before, 256 minor numbers are reserved for each mapping.
(A follow-up commit changes the number of minors reserved and the way
we deal with partitions over that number.)
If single_major is set to true, two new sysfs interfaces show up:
/sys/bus/rbd/{add,remove}_single_major. These are to be used instead
of /sys/bus/rbd/{add,remove}, which are disabled for backwards
compatibility reasons outlined above.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-13 15:28:57 +02:00
|
|
|
|
2017-11-13 10:35:40 +01:00
|
|
|
|
rbd: add support for single-major device number allocation scheme
Currently each rbd device is allocated its own major number, which
leads to a hard limit of 230-250 images mapped at once. This commit
adds support for a new single-major device number allocation scheme,
which is hidden behind a new single_major boolean module parameter and
is disabled by default for backwards compatibility reasons. (Old
userspace cannot correctly unmap images mapped under single-major
scheme and would essentially just unmap a random image, if that.)
$ rbd showmapped
id pool image snap device
0 rbd b100 - /dev/rbd0
1 rbd b101 - /dev/rbd1
2 rbd b102 - /dev/rbd2
3 rbd b103 - /dev/rbd3
Old scheme (modprobe rbd):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:24 /dev/rbd0
brw-rw---- 1 root disk 252, 0 Dec 10 12:28 /dev/rbd1
brw-rw---- 1 root disk 252, 1 Dec 10 12:28 /dev/rbd1p1
brw-rw---- 1 root disk 252, 2 Dec 10 12:28 /dev/rbd1p2
brw-rw---- 1 root disk 252, 3 Dec 10 12:28 /dev/rbd1p3
brw-rw---- 1 root disk 251, 0 Dec 10 12:28 /dev/rbd2
brw-rw---- 1 root disk 251, 1 Dec 10 12:28 /dev/rbd2p1
brw-rw---- 1 root disk 250, 0 Dec 10 12:24 /dev/rbd3
New scheme (modprobe rbd single_major=Y):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:30 /dev/rbd0
brw-rw---- 1 root disk 253, 256 Dec 10 12:30 /dev/rbd1
brw-rw---- 1 root disk 253, 257 Dec 10 12:30 /dev/rbd1p1
brw-rw---- 1 root disk 253, 258 Dec 10 12:30 /dev/rbd1p2
brw-rw---- 1 root disk 253, 259 Dec 10 12:30 /dev/rbd1p3
brw-rw---- 1 root disk 253, 512 Dec 10 12:30 /dev/rbd2
brw-rw---- 1 root disk 253, 513 Dec 10 12:30 /dev/rbd2p1
brw-rw---- 1 root disk 253, 768 Dec 10 12:30 /dev/rbd3
(major 253 was assigned dynamically at module load time)
The new limit is 4096 images mapped at once, and it comes from the fact
that, as before, 256 minor numbers are reserved for each mapping.
(A follow-up commit changes the number of minors reserved and the way
we deal with partitions over that number.)
If single_major is set to true, two new sysfs interfaces show up:
/sys/bus/rbd/{add,remove}_single_major. These are to be used instead
of /sys/bus/rbd/{add,remove}, which are disabled for backwards
compatibility reasons outlined above.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-13 15:28:57 +02:00
|
|
|
|
2017-11-13 10:35:40 +01:00
|
|
|
|
rbd: add support for single-major device number allocation scheme
Currently each rbd device is allocated its own major number, which
leads to a hard limit of 230-250 images mapped at once. This commit
adds support for a new single-major device number allocation scheme,
which is hidden behind a new single_major boolean module parameter and
is disabled by default for backwards compatibility reasons. (Old
userspace cannot correctly unmap images mapped under single-major
scheme and would essentially just unmap a random image, if that.)
$ rbd showmapped
id pool image snap device
0 rbd b100 - /dev/rbd0
1 rbd b101 - /dev/rbd1
2 rbd b102 - /dev/rbd2
3 rbd b103 - /dev/rbd3
Old scheme (modprobe rbd):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:24 /dev/rbd0
brw-rw---- 1 root disk 252, 0 Dec 10 12:28 /dev/rbd1
brw-rw---- 1 root disk 252, 1 Dec 10 12:28 /dev/rbd1p1
brw-rw---- 1 root disk 252, 2 Dec 10 12:28 /dev/rbd1p2
brw-rw---- 1 root disk 252, 3 Dec 10 12:28 /dev/rbd1p3
brw-rw---- 1 root disk 251, 0 Dec 10 12:28 /dev/rbd2
brw-rw---- 1 root disk 251, 1 Dec 10 12:28 /dev/rbd2p1
brw-rw---- 1 root disk 250, 0 Dec 10 12:24 /dev/rbd3
New scheme (modprobe rbd single_major=Y):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:30 /dev/rbd0
brw-rw---- 1 root disk 253, 256 Dec 10 12:30 /dev/rbd1
brw-rw---- 1 root disk 253, 257 Dec 10 12:30 /dev/rbd1p1
brw-rw---- 1 root disk 253, 258 Dec 10 12:30 /dev/rbd1p2
brw-rw---- 1 root disk 253, 259 Dec 10 12:30 /dev/rbd1p3
brw-rw---- 1 root disk 253, 512 Dec 10 12:30 /dev/rbd2
brw-rw---- 1 root disk 253, 513 Dec 10 12:30 /dev/rbd2p1
brw-rw---- 1 root disk 253, 768 Dec 10 12:30 /dev/rbd3
(major 253 was assigned dynamically at module load time)
The new limit is 4096 images mapped at once, and it comes from the fact
that, as before, 256 minor numbers are reserved for each mapping.
(A follow-up commit changes the number of minors reserved and the way
we deal with partitions over that number.)
If single_major is set to true, two new sysfs interfaces show up:
/sys/bus/rbd/{add,remove}_single_major. These are to be used instead
of /sys/bus/rbd/{add,remove}, which are disabled for backwards
compatibility reasons outlined above.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-13 15:28:57 +02:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
2012-01-29 13:57:44 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rbd: add support for single-major device number allocation scheme
Currently each rbd device is allocated its own major number, which
leads to a hard limit of 230-250 images mapped at once. This commit
adds support for a new single-major device number allocation scheme,
which is hidden behind a new single_major boolean module parameter and
is disabled by default for backwards compatibility reasons. (Old
userspace cannot correctly unmap images mapped under single-major
scheme and would essentially just unmap a random image, if that.)
$ rbd showmapped
id pool image snap device
0 rbd b100 - /dev/rbd0
1 rbd b101 - /dev/rbd1
2 rbd b102 - /dev/rbd2
3 rbd b103 - /dev/rbd3
Old scheme (modprobe rbd):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:24 /dev/rbd0
brw-rw---- 1 root disk 252, 0 Dec 10 12:28 /dev/rbd1
brw-rw---- 1 root disk 252, 1 Dec 10 12:28 /dev/rbd1p1
brw-rw---- 1 root disk 252, 2 Dec 10 12:28 /dev/rbd1p2
brw-rw---- 1 root disk 252, 3 Dec 10 12:28 /dev/rbd1p3
brw-rw---- 1 root disk 251, 0 Dec 10 12:28 /dev/rbd2
brw-rw---- 1 root disk 251, 1 Dec 10 12:28 /dev/rbd2p1
brw-rw---- 1 root disk 250, 0 Dec 10 12:24 /dev/rbd3
New scheme (modprobe rbd single_major=Y):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:30 /dev/rbd0
brw-rw---- 1 root disk 253, 256 Dec 10 12:30 /dev/rbd1
brw-rw---- 1 root disk 253, 257 Dec 10 12:30 /dev/rbd1p1
brw-rw---- 1 root disk 253, 258 Dec 10 12:30 /dev/rbd1p2
brw-rw---- 1 root disk 253, 259 Dec 10 12:30 /dev/rbd1p3
brw-rw---- 1 root disk 253, 512 Dec 10 12:30 /dev/rbd2
brw-rw---- 1 root disk 253, 513 Dec 10 12:30 /dev/rbd2p1
brw-rw---- 1 root disk 253, 768 Dec 10 12:30 /dev/rbd3
(major 253 was assigned dynamically at module load time)
The new limit is 4096 images mapped at once, and it comes from the fact
that, as before, 256 minor numbers are reserved for each mapping.
(A follow-up commit changes the number of minors reserved and the way
we deal with partitions over that number.)
If single_major is set to true, two new sysfs interfaces show up:
/sys/bus/rbd/{add,remove}_single_major. These are to be used instead
of /sys/bus/rbd/{add,remove}, which are disabled for backwards
compatibility reasons outlined above.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-13 15:28:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-11 19:38:00 +02:00
|
|
|
|
2013-05-08 22:50:04 -05:00
|
|
|
|
2012-01-29 13:57:44 -06:00
|
|
|
|
rbd: add support for single-major device number allocation scheme
Currently each rbd device is allocated its own major number, which
leads to a hard limit of 230-250 images mapped at once. This commit
adds support for a new single-major device number allocation scheme,
which is hidden behind a new single_major boolean module parameter and
is disabled by default for backwards compatibility reasons. (Old
userspace cannot correctly unmap images mapped under single-major
scheme and would essentially just unmap a random image, if that.)
$ rbd showmapped
id pool image snap device
0 rbd b100 - /dev/rbd0
1 rbd b101 - /dev/rbd1
2 rbd b102 - /dev/rbd2
3 rbd b103 - /dev/rbd3
Old scheme (modprobe rbd):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:24 /dev/rbd0
brw-rw---- 1 root disk 252, 0 Dec 10 12:28 /dev/rbd1
brw-rw---- 1 root disk 252, 1 Dec 10 12:28 /dev/rbd1p1
brw-rw---- 1 root disk 252, 2 Dec 10 12:28 /dev/rbd1p2
brw-rw---- 1 root disk 252, 3 Dec 10 12:28 /dev/rbd1p3
brw-rw---- 1 root disk 251, 0 Dec 10 12:28 /dev/rbd2
brw-rw---- 1 root disk 251, 1 Dec 10 12:28 /dev/rbd2p1
brw-rw---- 1 root disk 250, 0 Dec 10 12:24 /dev/rbd3
New scheme (modprobe rbd single_major=Y):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:30 /dev/rbd0
brw-rw---- 1 root disk 253, 256 Dec 10 12:30 /dev/rbd1
brw-rw---- 1 root disk 253, 257 Dec 10 12:30 /dev/rbd1p1
brw-rw---- 1 root disk 253, 258 Dec 10 12:30 /dev/rbd1p2
brw-rw---- 1 root disk 253, 259 Dec 10 12:30 /dev/rbd1p3
brw-rw---- 1 root disk 253, 512 Dec 10 12:30 /dev/rbd2
brw-rw---- 1 root disk 253, 513 Dec 10 12:30 /dev/rbd2p1
brw-rw---- 1 root disk 253, 768 Dec 10 12:30 /dev/rbd3
(major 253 was assigned dynamically at module load time)
The new limit is 4096 images mapped at once, and it comes from the fact
that, as before, 256 minor numbers are reserved for each mapping.
(A follow-up commit changes the number of minors reserved and the way
we deal with partitions over that number.)
If single_major is set to true, two new sysfs interfaces show up:
/sys/bus/rbd/{add,remove}_single_major. These are to be used instead
of /sys/bus/rbd/{add,remove}, which are disabled for backwards
compatibility reasons outlined above.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-13 15:28:57 +02:00
|
|
|
|
|
|
|
|
|
2013-12-16 19:26:32 +02:00
|
|
|
|
rbd: add support for single-major device number allocation scheme
Currently each rbd device is allocated its own major number, which
leads to a hard limit of 230-250 images mapped at once. This commit
adds support for a new single-major device number allocation scheme,
which is hidden behind a new single_major boolean module parameter and
is disabled by default for backwards compatibility reasons. (Old
userspace cannot correctly unmap images mapped under single-major
scheme and would essentially just unmap a random image, if that.)
$ rbd showmapped
id pool image snap device
0 rbd b100 - /dev/rbd0
1 rbd b101 - /dev/rbd1
2 rbd b102 - /dev/rbd2
3 rbd b103 - /dev/rbd3
Old scheme (modprobe rbd):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:24 /dev/rbd0
brw-rw---- 1 root disk 252, 0 Dec 10 12:28 /dev/rbd1
brw-rw---- 1 root disk 252, 1 Dec 10 12:28 /dev/rbd1p1
brw-rw---- 1 root disk 252, 2 Dec 10 12:28 /dev/rbd1p2
brw-rw---- 1 root disk 252, 3 Dec 10 12:28 /dev/rbd1p3
brw-rw---- 1 root disk 251, 0 Dec 10 12:28 /dev/rbd2
brw-rw---- 1 root disk 251, 1 Dec 10 12:28 /dev/rbd2p1
brw-rw---- 1 root disk 250, 0 Dec 10 12:24 /dev/rbd3
New scheme (modprobe rbd single_major=Y):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:30 /dev/rbd0
brw-rw---- 1 root disk 253, 256 Dec 10 12:30 /dev/rbd1
brw-rw---- 1 root disk 253, 257 Dec 10 12:30 /dev/rbd1p1
brw-rw---- 1 root disk 253, 258 Dec 10 12:30 /dev/rbd1p2
brw-rw---- 1 root disk 253, 259 Dec 10 12:30 /dev/rbd1p3
brw-rw---- 1 root disk 253, 512 Dec 10 12:30 /dev/rbd2
brw-rw---- 1 root disk 253, 513 Dec 10 12:30 /dev/rbd2p1
brw-rw---- 1 root disk 253, 768 Dec 10 12:30 /dev/rbd3
(major 253 was assigned dynamically at module load time)
The new limit is 4096 images mapped at once, and it comes from the fact
that, as before, 256 minor numbers are reserved for each mapping.
(A follow-up commit changes the number of minors reserved and the way
we deal with partitions over that number.)
If single_major is set to true, two new sysfs interfaces show up:
/sys/bus/rbd/{add,remove}_single_major. These are to be used instead
of /sys/bus/rbd/{add,remove}, which are disabled for backwards
compatibility reasons outlined above.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-13 15:28:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-16 19:26:32 +02:00
|
|
|
|
rbd: add support for single-major device number allocation scheme
Currently each rbd device is allocated its own major number, which
leads to a hard limit of 230-250 images mapped at once. This commit
adds support for a new single-major device number allocation scheme,
which is hidden behind a new single_major boolean module parameter and
is disabled by default for backwards compatibility reasons. (Old
userspace cannot correctly unmap images mapped under single-major
scheme and would essentially just unmap a random image, if that.)
$ rbd showmapped
id pool image snap device
0 rbd b100 - /dev/rbd0
1 rbd b101 - /dev/rbd1
2 rbd b102 - /dev/rbd2
3 rbd b103 - /dev/rbd3
Old scheme (modprobe rbd):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:24 /dev/rbd0
brw-rw---- 1 root disk 252, 0 Dec 10 12:28 /dev/rbd1
brw-rw---- 1 root disk 252, 1 Dec 10 12:28 /dev/rbd1p1
brw-rw---- 1 root disk 252, 2 Dec 10 12:28 /dev/rbd1p2
brw-rw---- 1 root disk 252, 3 Dec 10 12:28 /dev/rbd1p3
brw-rw---- 1 root disk 251, 0 Dec 10 12:28 /dev/rbd2
brw-rw---- 1 root disk 251, 1 Dec 10 12:28 /dev/rbd2p1
brw-rw---- 1 root disk 250, 0 Dec 10 12:24 /dev/rbd3
New scheme (modprobe rbd single_major=Y):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:30 /dev/rbd0
brw-rw---- 1 root disk 253, 256 Dec 10 12:30 /dev/rbd1
brw-rw---- 1 root disk 253, 257 Dec 10 12:30 /dev/rbd1p1
brw-rw---- 1 root disk 253, 258 Dec 10 12:30 /dev/rbd1p2
brw-rw---- 1 root disk 253, 259 Dec 10 12:30 /dev/rbd1p3
brw-rw---- 1 root disk 253, 512 Dec 10 12:30 /dev/rbd2
brw-rw---- 1 root disk 253, 513 Dec 10 12:30 /dev/rbd2p1
brw-rw---- 1 root disk 253, 768 Dec 10 12:30 /dev/rbd3
(major 253 was assigned dynamically at module load time)
The new limit is 4096 images mapped at once, and it comes from the fact
that, as before, 256 minor numbers are reserved for each mapping.
(A follow-up commit changes the number of minors reserved and the way
we deal with partitions over that number.)
If single_major is set to true, two new sysfs interfaces show up:
/sys/bus/rbd/{add,remove}_single_major. These are to be used instead
of /sys/bus/rbd/{add,remove}, which are disabled for backwards
compatibility reasons outlined above.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-13 15:28:57 +02:00
|
|
|
|
|
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-02 19:56:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-23 14:24:28 -07:00
|
|
|
|
|
|
|
|
|
rbd: add support for single-major device number allocation scheme
Currently each rbd device is allocated its own major number, which
leads to a hard limit of 230-250 images mapped at once. This commit
adds support for a new single-major device number allocation scheme,
which is hidden behind a new single_major boolean module parameter and
is disabled by default for backwards compatibility reasons. (Old
userspace cannot correctly unmap images mapped under single-major
scheme and would essentially just unmap a random image, if that.)
$ rbd showmapped
id pool image snap device
0 rbd b100 - /dev/rbd0
1 rbd b101 - /dev/rbd1
2 rbd b102 - /dev/rbd2
3 rbd b103 - /dev/rbd3
Old scheme (modprobe rbd):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:24 /dev/rbd0
brw-rw---- 1 root disk 252, 0 Dec 10 12:28 /dev/rbd1
brw-rw---- 1 root disk 252, 1 Dec 10 12:28 /dev/rbd1p1
brw-rw---- 1 root disk 252, 2 Dec 10 12:28 /dev/rbd1p2
brw-rw---- 1 root disk 252, 3 Dec 10 12:28 /dev/rbd1p3
brw-rw---- 1 root disk 251, 0 Dec 10 12:28 /dev/rbd2
brw-rw---- 1 root disk 251, 1 Dec 10 12:28 /dev/rbd2p1
brw-rw---- 1 root disk 250, 0 Dec 10 12:24 /dev/rbd3
New scheme (modprobe rbd single_major=Y):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:30 /dev/rbd0
brw-rw---- 1 root disk 253, 256 Dec 10 12:30 /dev/rbd1
brw-rw---- 1 root disk 253, 257 Dec 10 12:30 /dev/rbd1p1
brw-rw---- 1 root disk 253, 258 Dec 10 12:30 /dev/rbd1p2
brw-rw---- 1 root disk 253, 259 Dec 10 12:30 /dev/rbd1p3
brw-rw---- 1 root disk 253, 512 Dec 10 12:30 /dev/rbd2
brw-rw---- 1 root disk 253, 513 Dec 10 12:30 /dev/rbd2p1
brw-rw---- 1 root disk 253, 768 Dec 10 12:30 /dev/rbd3
(major 253 was assigned dynamically at module load time)
The new limit is 4096 images mapped at once, and it comes from the fact
that, as before, 256 minor numbers are reserved for each mapping.
(A follow-up commit changes the number of minors reserved and the way
we deal with partitions over that number.)
If single_major is set to true, two new sysfs interfaces show up:
/sys/bus/rbd/{add,remove}_single_major. These are to be used instead
of /sys/bus/rbd/{add,remove}, which are disabled for backwards
compatibility reasons outlined above.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-13 15:28:57 +02:00
|
|
|
|
|
|
|
|
|
2017-03-02 19:56:57 +01:00
|
|
|
|
2013-08-23 14:24:28 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rbd: add support for single-major device number allocation scheme
Currently each rbd device is allocated its own major number, which
leads to a hard limit of 230-250 images mapped at once. This commit
adds support for a new single-major device number allocation scheme,
which is hidden behind a new single_major boolean module parameter and
is disabled by default for backwards compatibility reasons. (Old
userspace cannot correctly unmap images mapped under single-major
scheme and would essentially just unmap a random image, if that.)
$ rbd showmapped
id pool image snap device
0 rbd b100 - /dev/rbd0
1 rbd b101 - /dev/rbd1
2 rbd b102 - /dev/rbd2
3 rbd b103 - /dev/rbd3
Old scheme (modprobe rbd):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:24 /dev/rbd0
brw-rw---- 1 root disk 252, 0 Dec 10 12:28 /dev/rbd1
brw-rw---- 1 root disk 252, 1 Dec 10 12:28 /dev/rbd1p1
brw-rw---- 1 root disk 252, 2 Dec 10 12:28 /dev/rbd1p2
brw-rw---- 1 root disk 252, 3 Dec 10 12:28 /dev/rbd1p3
brw-rw---- 1 root disk 251, 0 Dec 10 12:28 /dev/rbd2
brw-rw---- 1 root disk 251, 1 Dec 10 12:28 /dev/rbd2p1
brw-rw---- 1 root disk 250, 0 Dec 10 12:24 /dev/rbd3
New scheme (modprobe rbd single_major=Y):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:30 /dev/rbd0
brw-rw---- 1 root disk 253, 256 Dec 10 12:30 /dev/rbd1
brw-rw---- 1 root disk 253, 257 Dec 10 12:30 /dev/rbd1p1
brw-rw---- 1 root disk 253, 258 Dec 10 12:30 /dev/rbd1p2
brw-rw---- 1 root disk 253, 259 Dec 10 12:30 /dev/rbd1p3
brw-rw---- 1 root disk 253, 512 Dec 10 12:30 /dev/rbd2
brw-rw---- 1 root disk 253, 513 Dec 10 12:30 /dev/rbd2p1
brw-rw---- 1 root disk 253, 768 Dec 10 12:30 /dev/rbd3
(major 253 was assigned dynamically at module load time)
The new limit is 4096 images mapped at once, and it comes from the fact
that, as before, 256 minor numbers are reserved for each mapping.
(A follow-up commit changes the number of minors reserved and the way
we deal with partitions over that number.)
If single_major is set to true, two new sysfs interfaces show up:
/sys/bus/rbd/{add,remove}_single_major. These are to be used instead
of /sys/bus/rbd/{add,remove}, which are disabled for backwards
compatibility reasons outlined above.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-13 15:28:57 +02:00
|
|
|
|
|
|
|
|
|
2017-03-02 19:56:57 +01:00
|
|
|
|
2013-08-23 14:24:28 -07:00
|
|
|
|
2012-01-29 13:57:44 -06:00
|
|
|
|
2013-12-13 15:28:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rbd: add support for single-major device number allocation scheme
Currently each rbd device is allocated its own major number, which
leads to a hard limit of 230-250 images mapped at once. This commit
adds support for a new single-major device number allocation scheme,
which is hidden behind a new single_major boolean module parameter and
is disabled by default for backwards compatibility reasons. (Old
userspace cannot correctly unmap images mapped under single-major
scheme and would essentially just unmap a random image, if that.)
$ rbd showmapped
id pool image snap device
0 rbd b100 - /dev/rbd0
1 rbd b101 - /dev/rbd1
2 rbd b102 - /dev/rbd2
3 rbd b103 - /dev/rbd3
Old scheme (modprobe rbd):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:24 /dev/rbd0
brw-rw---- 1 root disk 252, 0 Dec 10 12:28 /dev/rbd1
brw-rw---- 1 root disk 252, 1 Dec 10 12:28 /dev/rbd1p1
brw-rw---- 1 root disk 252, 2 Dec 10 12:28 /dev/rbd1p2
brw-rw---- 1 root disk 252, 3 Dec 10 12:28 /dev/rbd1p3
brw-rw---- 1 root disk 251, 0 Dec 10 12:28 /dev/rbd2
brw-rw---- 1 root disk 251, 1 Dec 10 12:28 /dev/rbd2p1
brw-rw---- 1 root disk 250, 0 Dec 10 12:24 /dev/rbd3
New scheme (modprobe rbd single_major=Y):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:30 /dev/rbd0
brw-rw---- 1 root disk 253, 256 Dec 10 12:30 /dev/rbd1
brw-rw---- 1 root disk 253, 257 Dec 10 12:30 /dev/rbd1p1
brw-rw---- 1 root disk 253, 258 Dec 10 12:30 /dev/rbd1p2
brw-rw---- 1 root disk 253, 259 Dec 10 12:30 /dev/rbd1p3
brw-rw---- 1 root disk 253, 512 Dec 10 12:30 /dev/rbd2
brw-rw---- 1 root disk 253, 513 Dec 10 12:30 /dev/rbd2p1
brw-rw---- 1 root disk 253, 768 Dec 10 12:30 /dev/rbd3
(major 253 was assigned dynamically at module load time)
The new limit is 4096 images mapped at once, and it comes from the fact
that, as before, 256 minor numbers are reserved for each mapping.
(A follow-up commit changes the number of minors reserved and the way
we deal with partitions over that number.)
If single_major is set to true, two new sysfs interfaces show up:
/sys/bus/rbd/{add,remove}_single_major. These are to be used instead
of /sys/bus/rbd/{add,remove}, which are disabled for backwards
compatibility reasons outlined above.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-13 15:28:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-13 15:28:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-01-29 13:57:44 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-23 14:24:28 -07:00
|
|
|
|
2012-01-29 13:57:44 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-01 10:17:15 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-06 16:00:54 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
rbd: fix copyup completion race
For write/discard obj_requests that involved a copyup method call, the
opcode of the first op is CEPH_OSD_OP_CALL and the ->callback is
rbd_img_obj_copyup_callback(). The latter frees copyup pages, sets
->xferred and delegates to rbd_img_obj_callback(), the "normal" image
object callback, for reporting to block layer and putting refs.
rbd_osd_req_callback() however treats CEPH_OSD_OP_CALL as a trivial op,
which means obj_request is marked done in rbd_osd_trivial_callback(),
*before* ->callback is invoked and rbd_img_obj_copyup_callback() has
a chance to run. Marking obj_request done essentially means giving
rbd_img_obj_callback() a license to end it at any moment, so if another
obj_request from the same img_request is being completed concurrently,
rbd_img_obj_end_request() may very well be called on such prematurally
marked done request:
<obj_request-1/2 reply>
handle_reply()
rbd_osd_req_callback()
rbd_osd_trivial_callback()
rbd_obj_request_complete()
rbd_img_obj_copyup_callback()
rbd_img_obj_callback()
<obj_request-2/2 reply>
handle_reply()
rbd_osd_req_callback()
rbd_osd_trivial_callback()
for_each_obj_request(obj_request->img_request) {
rbd_img_obj_end_request(obj_request-1/2)
rbd_img_obj_end_request(obj_request-2/2) <--
}
Calling rbd_img_obj_end_request() on such a request leads to trouble,
in particular because its ->xfferred is 0. We report 0 to the block
layer with blk_update_request(), get back 1 for "this request has more
data in flight" and then trip on
rbd_assert(more ^ (which == img_request->obj_request_count));
with rhs (which == ...) being 1 because rbd_img_obj_end_request() has
been called for both requests and lhs (more) being 1 because we haven't
got a chance to set ->xfferred in rbd_img_obj_copyup_callback() yet.
To fix this, leverage that rbd wants to call class methods in only two
cases: one is a generic method call wrapper (obj_request is standalone)
and the other is a copyup (obj_request is part of an img_request). So
make a dedicated handler for CEPH_OSD_OP_CALL and directly invoke
rbd_img_obj_copyup_callback() from it if obj_request is part of an
img_request, similar to how CEPH_OSD_OP_READ handler invokes
rbd_img_obj_request_read_callback().
Since rbd_img_obj_copyup_callback() is now being called from the OSD
request callback (only), it is renamed to rbd_osd_copyup_callback().
Cc: Alex Elder <elder@linaro.org>
Cc: stable@vger.kernel.org # 3.10+, needs backporting for < 3.18
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Alex Elder <elder@linaro.org>
2015-07-16 17:36:11 +03:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2013-04-26 15:44:36 -05:00
|
|
|
|
|
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
2013-05-06 09:51:30 -05:00
|
|
|
|
2014-07-23 17:11:19 +04:00
|
|
|
|
2014-07-24 10:42:13 +04:00
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
|
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-21 15:10:11 -07:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2012-01-29 13:57:44 -06:00
|
|
|
|
2013-01-14 12:43:31 -06:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-02-05 13:23:12 -06:00
|
|
|
|
2013-01-14 12:43:31 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-05 13:23:12 -06:00
|
|
|
|
2013-01-14 12:43:31 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-16 09:29:16 -06:00
|
|
|
|
2012-08-10 13:12:07 -07:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-05 21:52:57 -04:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
|
|
|
|
|
2013-01-14 12:43:31 -06:00
|
|
|
|
|
|
|
|
|
2013-02-05 13:23:12 -06:00
|
|
|
|
2013-01-14 12:43:31 -06:00
|
|
|
|
2013-02-05 13:23:12 -06:00
|
|
|
|
2013-01-14 12:43:31 -06:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
2012-11-16 09:29:16 -06:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
|
|
|
|
|
2013-09-24 11:25:36 +08:00
|
|
|
|
|
|
|
|
|
2017-10-12 12:35:19 +02:00
|
|
|
|
2013-09-24 11:25:36 +08:00
|
|
|
|
2017-10-12 12:35:19 +02:00
|
|
|
|
2013-09-24 11:25:36 +08:00
|
|
|
|
|
|
|
|
|
2017-10-12 12:35:19 +02:00
|
|
|
|
2013-09-24 11:25:36 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-10-12 12:35:19 +02:00
|
|
|
|
|
|
|
|
|
2013-09-24 11:25:36 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-10-12 12:35:19 +02:00
|
|
|
|
2013-09-24 11:25:36 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
2013-09-24 11:25:36 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-16 15:04:20 -05:00
|
|
|
|
2013-05-31 17:40:45 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2012-08-10 13:12:07 -07:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-20 17:32:08 -06:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-03 18:16:07 +01:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-05-29 11:19:00 -05:00
|
|
|
|
2012-07-03 16:01:18 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-29 11:19:00 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2012-01-29 13:57:44 -06:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2012-01-29 13:57:44 -06:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-02-20 17:32:08 -06:00
|
|
|
|
2012-01-29 13:57:44 -06:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-05-29 11:19:00 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-05-29 11:19:00 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2012-07-03 16:01:18 -05:00
|
|
|
|
|
|
|
|
|
2013-02-20 17:32:08 -06:00
|
|
|
|
|
|
|
|
|
2010-09-26 12:59:37 +04:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2012-08-10 13:12:07 -07:00
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2012-08-10 13:12:07 -07:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2012-08-10 13:12:07 -07:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2012-07-03 16:01:18 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2012-08-10 13:12:07 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
|
|
|
|
|
2012-08-10 13:12:07 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2011-03-21 15:10:11 -07:00
|
|
|
|
2015-06-22 13:24:48 +03:00
|
|
|
|
2011-03-21 15:10:11 -07:00
|
|
|
|
|
|
|
|
|
2015-06-23 16:21:19 +03:00
|
|
|
|
2011-03-21 15:10:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-10 13:12:07 -07:00
|
|
|
|
|
|
|
|
|
2016-09-20 14:23:17 +02:00
|
|
|
|
2017-04-13 12:17:39 +02:00
|
|
|
|
2015-06-22 13:24:48 +03:00
|
|
|
|
2011-03-21 15:10:11 -07:00
|
|
|
|
|
|
|
|
|
2012-07-03 16:01:18 -05:00
|
|
|
|
2015-06-23 16:21:19 +03:00
|
|
|
|
2011-03-21 15:10:11 -07:00
|
|
|
|
|
|
|
|
|
2012-10-22 11:31:26 -05:00
|
|
|
|
2012-08-10 13:12:07 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-20 14:23:17 +02:00
|
|
|
|
2017-04-13 12:17:39 +02:00
|
|
|
|
2015-06-22 13:24:48 +03:00
|
|
|
|
2011-03-21 15:10:11 -07:00
|
|
|
|
|
|
|
|
|
2013-01-20 14:44:42 -06:00
|
|
|
|
2015-06-23 16:21:19 +03:00
|
|
|
|
2013-01-20 14:44:42 -06:00
|
|
|
|
2016-09-20 14:23:17 +02:00
|
|
|
|
2017-04-13 12:17:39 +02:00
|
|
|
|
2013-01-20 14:44:42 -06:00
|
|
|
|
|
|
|
|
|
2015-06-23 16:21:19 +03:00
|
|
|
|
2013-01-20 14:44:42 -06:00
|
|
|
|
2016-09-20 14:23:17 +02:00
|
|
|
|
2017-04-13 12:17:39 +02:00
|
|
|
|
2013-01-20 14:44:42 -06:00
|
|
|
|
2011-03-21 15:10:11 -07:00
|
|
|
|
|
|
|
|
|
2012-07-03 16:01:18 -05:00
|
|
|
|
2011-03-21 15:10:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-03 16:01:18 -05:00
|
|
|
|
2011-03-21 15:10:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-22 13:24:48 +03:00
|
|
|
|
2011-03-21 15:10:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-22 13:24:48 +03:00
|
|
|
|
2011-03-21 15:10:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-23 16:21:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-10 13:12:07 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-20 14:23:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-13 12:17:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-21 15:10:11 -07:00
|
|
|
|
2015-06-22 13:24:48 +03:00
|
|
|
|
|
|
|
|
|
2011-03-21 15:10:11 -07:00
|
|
|
|
2015-06-22 13:24:48 +03:00
|
|
|
|
2011-03-21 15:10:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-03-13 11:21:35 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-01 22:22:16 +08:00
|
|
|
|
|
|
|
|
|
2014-03-13 11:21:35 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2013-05-16 15:04:20 -05:00
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2012-08-10 13:12:07 -07:00
|
|
|
|
2011-03-21 15:10:11 -07:00
|
|
|
|
2013-05-31 17:40:45 -05:00
|
|
|
|
2012-08-10 13:12:07 -07:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2012-07-03 16:01:18 -05:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2012-08-10 13:12:07 -07:00
|
|
|
|
2013-05-31 17:40:45 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-01-29 13:57:43 -06:00
|
|
|
|
2012-01-29 13:57:44 -06:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-20 17:32:08 -06:00
|
|
|
|
2012-04-04 13:35:44 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2012-04-04 13:35:44 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2012-07-10 20:30:11 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-25 09:32:40 -05:00
|
|
|
|
|
|
|
|
|
2012-08-02 11:29:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-20 22:17:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-02 11:29:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-25 09:32:40 -05:00
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:22 +01:00
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
2012-08-02 11:29:46 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rbd: fixes in rbd_header_from_disk()
This fixes a few issues in rbd_header_from_disk():
- There is a check intended to catch overflow, but it's wrong in
two ways.
- First, the type we don't want to overflow is size_t, not
unsigned int, and there is now a SIZE_MAX we can use for
use with that type.
- Second, we're allocating the snapshot ids and snapshot
image sizes separately (each has type u64; on disk they
grouped together as a rbd_image_header_ondisk structure).
So we can use the size of u64 in this overflow check.
- If there are no snapshots, then there should be no snapshot
names. Enforce this, and issue a warning if we encounter a
header with no snapshots but a non-zero snap_names_len.
- When saving the snapshot names into the header, be more direct
in defining the offset in the on-disk structure from which
they're being copied by using "snap_count" rather than "i"
in the array index.
- If an error occurs, the "snapc" and "snap_names" fields are
freed at the end of the function. Make those fields be null
pointers after they're freed, to be explicit that they are
no longer valid.
- Finally, move the definition of the local variable "i" to the
innermost scope in which it's needed.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2012-07-10 20:30:10 -05:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
2012-08-23 23:22:06 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
2012-07-19 17:12:59 -05:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-07 12:03:36 -06:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
2012-02-07 12:03:36 -06:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
2012-08-23 23:22:06 -05:00
|
|
|
|
|
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
2012-08-23 23:22:06 -05:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-19 17:12:59 -05:00
|
|
|
|
|
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
2016-09-11 12:21:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
2012-07-19 17:12:59 -05:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
2012-08-23 23:22:06 -05:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-06 09:51:30 -05:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
2012-08-23 23:22:06 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2012-07-19 17:12:59 -05:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
2012-08-23 23:22:06 -05:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:22 +01:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2012-07-09 21:04:24 -05:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
2012-08-23 23:22:06 -05:00
|
|
|
|
2012-08-31 17:29:51 -05:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-26 09:43:47 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
|
|
|
|
|
2012-07-19 17:12:59 -05:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rbd: fixes in rbd_header_from_disk()
This fixes a few issues in rbd_header_from_disk():
- There is a check intended to catch overflow, but it's wrong in
two ways.
- First, the type we don't want to overflow is size_t, not
unsigned int, and there is now a SIZE_MAX we can use for
use with that type.
- Second, we're allocating the snapshot ids and snapshot
image sizes separately (each has type u64; on disk they
grouped together as a rbd_image_header_ondisk structure).
So we can use the size of u64 in this overflow check.
- If there are no snapshots, then there should be no snapshot
names. Enforce this, and issue a warning if we encounter a
header with no snapshots but a non-zero snap_names_len.
- When saving the snapshot names into the header, be more direct
in defining the offset in the on-disk structure from which
they're being copied by using "snap_count" rather than "i"
in the array index.
- If an error occurs, the "snapc" and "snap_names" fields are
freed at the end of the function. Make those fields be null
pointers after they're freed, to be explicit that they are
no longer valid.
- Finally, move the definition of the local variable "i" to the
innermost scope in which it's needed.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2012-07-10 20:30:10 -05:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-01 12:43:03 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-01 12:43:03 -05:00
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
2013-05-01 12:43:03 -05:00
|
|
|
|
|
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
2013-05-01 12:43:03 -05:00
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
|
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
|
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
2013-09-04 17:57:31 -07:00
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
|
|
|
|
|
2013-09-04 17:57:31 -07:00
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
2013-09-04 17:57:31 -07:00
|
|
|
|
|
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
|
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-10 20:30:11 -05:00
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
|
|
|
|
|
2013-04-25 23:15:08 -05:00
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-06 07:40:30 -05:00
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-25 23:15:08 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2013-04-27 09:59:30 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-28 23:32:34 -05:00
|
|
|
|
|
|
|
|
|
2012-08-09 10:33:26 -07:00
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:22 +01:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2012-08-09 10:33:26 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:22 +01:00
|
|
|
|
2012-08-09 10:33:26 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-06 16:00:54 -05:00
|
|
|
|
2012-08-09 10:33:26 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-11-23 17:19:00 -08:00
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-11-23 17:19:00 -08:00
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-11-23 17:19:00 -08:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-11-23 17:19:00 -08:00
|
|
|
|
|
|
|
|
|
2010-10-11 21:15:11 +02:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-11-23 17:19:00 -08:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-13 20:35:37 -05:00
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-22 20:54:25 -05:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
rbd: simplify rbd_rq_fn()
When processing a request, rbd_rq_fn() makes clones of the bio's in
the request's bio chain and submits the results to osd's to be
satisfied. If a request bio straddles the boundary between objects
backing the rbd image, it must be represented by two cloned bio's,
one for the first part (at the end of one object) and one for the
second (at the beginning of the next object).
This has been handled by a function bio_chain_clone(), which
includes an interface only a mother could love, and which has
been found to have other problems.
This patch defines two new fairly generic bio functions (one which
replaces bio_chain_clone()) to help out the situation, and then
revises rbd_rq_fn() to make use of them.
First, bio_clone_range() clones a portion of a single bio, starting
at a given offset within the bio and including only as many bytes
as requested. As a convenience, a request to clone the entire bio
is passed directly to bio_clone().
Second, bio_chain_clone_range() performs a similar function,
producing a chain of cloned bio's covering a sub-range of the
source chain. No bio_pair structures are used, and if successful
the result will represent exactly the specified range.
Using bio_chain_clone_range() makes bio_rq_fn() a little easier
to understand, because it avoids the need to pass very much
state information between consecutive calls. By avoiding the need
to track a bio_pair structure, it also eliminates the problem
described here: http://tracker.newdream.net/issues/2933
Note that a block request (and therefore the complete length of
a bio chain processed in rbd_rq_fn()) is an unsigned int, while
the result of rbd_segment_length() is u64. This change makes
this range trunctation explicit, and trips a bug if the the
segment boundary is too far off.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2012-10-20 22:17:27 -05:00
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
rbd: simplify rbd_rq_fn()
When processing a request, rbd_rq_fn() makes clones of the bio's in
the request's bio chain and submits the results to osd's to be
satisfied. If a request bio straddles the boundary between objects
backing the rbd image, it must be represented by two cloned bio's,
one for the first part (at the end of one object) and one for the
second (at the beginning of the next object).
This has been handled by a function bio_chain_clone(), which
includes an interface only a mother could love, and which has
been found to have other problems.
This patch defines two new fairly generic bio functions (one which
replaces bio_chain_clone()) to help out the situation, and then
revises rbd_rq_fn() to make use of them.
First, bio_clone_range() clones a portion of a single bio, starting
at a given offset within the bio and including only as many bytes
as requested. As a convenience, a request to clone the entire bio
is passed directly to bio_clone().
Second, bio_chain_clone_range() performs a similar function,
producing a chain of cloned bio's covering a sub-range of the
source chain. No bio_pair structures are used, and if successful
the result will represent exactly the specified range.
Using bio_chain_clone_range() makes bio_rq_fn() a little easier
to understand, because it avoids the need to pass very much
state information between consecutive calls. By avoiding the need
to track a bio_pair structure, it also eliminates the problem
described here: http://tracker.newdream.net/issues/2933
Note that a block request (and therefore the complete length of
a bio chain processed in rbd_rq_fn()) is an unsigned int, while
the result of rbd_segment_length() is u64. This change makes
this range trunctation explicit, and trips a bug if the the
segment boundary is too far off.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2012-10-20 22:17:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
rbd: simplify rbd_rq_fn()
When processing a request, rbd_rq_fn() makes clones of the bio's in
the request's bio chain and submits the results to osd's to be
satisfied. If a request bio straddles the boundary between objects
backing the rbd image, it must be represented by two cloned bio's,
one for the first part (at the end of one object) and one for the
second (at the beginning of the next object).
This has been handled by a function bio_chain_clone(), which
includes an interface only a mother could love, and which has
been found to have other problems.
This patch defines two new fairly generic bio functions (one which
replaces bio_chain_clone()) to help out the situation, and then
revises rbd_rq_fn() to make use of them.
First, bio_clone_range() clones a portion of a single bio, starting
at a given offset within the bio and including only as many bytes
as requested. As a convenience, a request to clone the entire bio
is passed directly to bio_clone().
Second, bio_chain_clone_range() performs a similar function,
producing a chain of cloned bio's covering a sub-range of the
source chain. No bio_pair structures are used, and if successful
the result will represent exactly the specified range.
Using bio_chain_clone_range() makes bio_rq_fn() a little easier
to understand, because it avoids the need to pass very much
state information between consecutive calls. By avoiding the need
to track a bio_pair structure, it also eliminates the problem
described here: http://tracker.newdream.net/issues/2933
Note that a block request (and therefore the complete length of
a bio chain processed in rbd_rq_fn()) is an unsigned int, while
the result of rbd_segment_length() is u64. This change makes
this range trunctation explicit, and trips a bug if the the
segment boundary is too far off.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2012-10-20 22:17:27 -05:00
|
|
|
|
|
|
|
|
|
rbd: use bio_clone_fast() instead of bio_clone()
bio_clone() makes a copy of the bi_io_vec, but rbd never changes that,
so there is no need for a copy.
bio_clone_fast() can be used instead, which avoids making the copy.
This requires that we provide a bio_set. bio_clone() uses fs_bio_set,
but it isn't, in general, safe to use the same bio_set at different
levels of the stack, as that can lead to deadlocks. As filesystems
use fs_bio_set, block devices shouldn't.
As rbd never stacks, it is safe to have a single global bio_set for
all rbd devices to use. So allocate that when the module is
initialised, and use it with bio_clone_fast().
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2017-06-18 14:38:58 +10:00
|
|
|
|
rbd: simplify rbd_rq_fn()
When processing a request, rbd_rq_fn() makes clones of the bio's in
the request's bio chain and submits the results to osd's to be
satisfied. If a request bio straddles the boundary between objects
backing the rbd image, it must be represented by two cloned bio's,
one for the first part (at the end of one object) and one for the
second (at the beginning of the next object).
This has been handled by a function bio_chain_clone(), which
includes an interface only a mother could love, and which has
been found to have other problems.
This patch defines two new fairly generic bio functions (one which
replaces bio_chain_clone()) to help out the situation, and then
revises rbd_rq_fn() to make use of them.
First, bio_clone_range() clones a portion of a single bio, starting
at a given offset within the bio and including only as many bytes
as requested. As a convenience, a request to clone the entire bio
is passed directly to bio_clone().
Second, bio_chain_clone_range() performs a similar function,
producing a chain of cloned bio's covering a sub-range of the
source chain. No bio_pair structures are used, and if successful
the result will represent exactly the specified range.
Using bio_chain_clone_range() makes bio_rq_fn() a little easier
to understand, because it avoids the need to pass very much
state information between consecutive calls. By avoiding the need
to track a bio_pair structure, it also eliminates the problem
described here: http://tracker.newdream.net/issues/2933
Note that a block request (and therefore the complete length of
a bio chain processed in rbd_rq_fn()) is an unsigned int, while
the result of rbd_segment_length() is u64. This change makes
this range trunctation explicit, and trips a bug if the the
segment boundary is too far off.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2012-10-20 22:17:27 -05:00
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-08-07 14:31:11 -07:00
|
|
|
|
2013-10-11 15:44:27 -07:00
|
|
|
|
rbd: simplify rbd_rq_fn()
When processing a request, rbd_rq_fn() makes clones of the bio's in
the request's bio chain and submits the results to osd's to be
satisfied. If a request bio straddles the boundary between objects
backing the rbd image, it must be represented by two cloned bio's,
one for the first part (at the end of one object) and one for the
second (at the beginning of the next object).
This has been handled by a function bio_chain_clone(), which
includes an interface only a mother could love, and which has
been found to have other problems.
This patch defines two new fairly generic bio functions (one which
replaces bio_chain_clone()) to help out the situation, and then
revises rbd_rq_fn() to make use of them.
First, bio_clone_range() clones a portion of a single bio, starting
at a given offset within the bio and including only as many bytes
as requested. As a convenience, a request to clone the entire bio
is passed directly to bio_clone().
Second, bio_chain_clone_range() performs a similar function,
producing a chain of cloned bio's covering a sub-range of the
source chain. No bio_pair structures are used, and if successful
the result will represent exactly the specified range.
Using bio_chain_clone_range() makes bio_rq_fn() a little easier
to understand, because it avoids the need to pass very much
state information between consecutive calls. By avoiding the need
to track a bio_pair structure, it also eliminates the problem
described here: http://tracker.newdream.net/issues/2933
Note that a block request (and therefore the complete length of
a bio chain processed in rbd_rq_fn()) is an unsigned int, while
the result of rbd_segment_length() is u64. This change makes
this range trunctation explicit, and trips a bug if the the
segment boundary is too far off.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2012-10-20 22:17:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-10-11 15:44:27 -07:00
|
|
|
|
rbd: simplify rbd_rq_fn()
When processing a request, rbd_rq_fn() makes clones of the bio's in
the request's bio chain and submits the results to osd's to be
satisfied. If a request bio straddles the boundary between objects
backing the rbd image, it must be represented by two cloned bio's,
one for the first part (at the end of one object) and one for the
second (at the beginning of the next object).
This has been handled by a function bio_chain_clone(), which
includes an interface only a mother could love, and which has
been found to have other problems.
This patch defines two new fairly generic bio functions (one which
replaces bio_chain_clone()) to help out the situation, and then
revises rbd_rq_fn() to make use of them.
First, bio_clone_range() clones a portion of a single bio, starting
at a given offset within the bio and including only as many bytes
as requested. As a convenience, a request to clone the entire bio
is passed directly to bio_clone().
Second, bio_chain_clone_range() performs a similar function,
producing a chain of cloned bio's covering a sub-range of the
source chain. No bio_pair structures are used, and if successful
the result will represent exactly the specified range.
Using bio_chain_clone_range() makes bio_rq_fn() a little easier
to understand, because it avoids the need to pass very much
state information between consecutive calls. By avoiding the need
to track a bio_pair structure, it also eliminates the problem
described here: http://tracker.newdream.net/issues/2933
Note that a block request (and therefore the complete length of
a bio chain processed in rbd_rq_fn()) is an unsigned int, while
the result of rbd_segment_length() is u64. This change makes
this range trunctation explicit, and trips a bug if the the
segment boundary is too far off.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2012-10-20 22:17:27 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
rbd: simplify rbd_rq_fn()
When processing a request, rbd_rq_fn() makes clones of the bio's in
the request's bio chain and submits the results to osd's to be
satisfied. If a request bio straddles the boundary between objects
backing the rbd image, it must be represented by two cloned bio's,
one for the first part (at the end of one object) and one for the
second (at the beginning of the next object).
This has been handled by a function bio_chain_clone(), which
includes an interface only a mother could love, and which has
been found to have other problems.
This patch defines two new fairly generic bio functions (one which
replaces bio_chain_clone()) to help out the situation, and then
revises rbd_rq_fn() to make use of them.
First, bio_clone_range() clones a portion of a single bio, starting
at a given offset within the bio and including only as many bytes
as requested. As a convenience, a request to clone the entire bio
is passed directly to bio_clone().
Second, bio_chain_clone_range() performs a similar function,
producing a chain of cloned bio's covering a sub-range of the
source chain. No bio_pair structures are used, and if successful
the result will represent exactly the specified range.
Using bio_chain_clone_range() makes bio_rq_fn() a little easier
to understand, because it avoids the need to pass very much
state information between consecutive calls. By avoiding the need
to track a bio_pair structure, it also eliminates the problem
described here: http://tracker.newdream.net/issues/2933
Note that a block request (and therefore the complete length of
a bio chain processed in rbd_rq_fn()) is an unsigned int, while
the result of rbd_segment_length() is u64. This change makes
this range trunctation explicit, and trips a bug if the the
segment boundary is too far off.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2012-10-20 22:17:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-01 10:17:15 -05:00
|
|
|
|
|
|
|
|
|
rbd: simplify rbd_rq_fn()
When processing a request, rbd_rq_fn() makes clones of the bio's in
the request's bio chain and submits the results to osd's to be
satisfied. If a request bio straddles the boundary between objects
backing the rbd image, it must be represented by two cloned bio's,
one for the first part (at the end of one object) and one for the
second (at the beginning of the next object).
This has been handled by a function bio_chain_clone(), which
includes an interface only a mother could love, and which has
been found to have other problems.
This patch defines two new fairly generic bio functions (one which
replaces bio_chain_clone()) to help out the situation, and then
revises rbd_rq_fn() to make use of them.
First, bio_clone_range() clones a portion of a single bio, starting
at a given offset within the bio and including only as many bytes
as requested. As a convenience, a request to clone the entire bio
is passed directly to bio_clone().
Second, bio_chain_clone_range() performs a similar function,
producing a chain of cloned bio's covering a sub-range of the
source chain. No bio_pair structures are used, and if successful
the result will represent exactly the specified range.
Using bio_chain_clone_range() makes bio_rq_fn() a little easier
to understand, because it avoids the need to pass very much
state information between consecutive calls. By avoiding the need
to track a bio_pair structure, it also eliminates the problem
described here: http://tracker.newdream.net/issues/2933
Note that a block request (and therefore the complete length of
a bio chain processed in rbd_rq_fn()) is an unsigned int, while
the result of rbd_segment_length() is u64. This change makes
this range trunctation explicit, and trips a bug if the the
segment boundary is too far off.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2012-10-20 22:17:27 -05:00
|
|
|
|
2012-11-01 10:17:15 -05:00
|
|
|
|
2013-10-11 15:44:27 -07:00
|
|
|
|
rbd: simplify rbd_rq_fn()
When processing a request, rbd_rq_fn() makes clones of the bio's in
the request's bio chain and submits the results to osd's to be
satisfied. If a request bio straddles the boundary between objects
backing the rbd image, it must be represented by two cloned bio's,
one for the first part (at the end of one object) and one for the
second (at the beginning of the next object).
This has been handled by a function bio_chain_clone(), which
includes an interface only a mother could love, and which has
been found to have other problems.
This patch defines two new fairly generic bio functions (one which
replaces bio_chain_clone()) to help out the situation, and then
revises rbd_rq_fn() to make use of them.
First, bio_clone_range() clones a portion of a single bio, starting
at a given offset within the bio and including only as many bytes
as requested. As a convenience, a request to clone the entire bio
is passed directly to bio_clone().
Second, bio_chain_clone_range() performs a similar function,
producing a chain of cloned bio's covering a sub-range of the
source chain. No bio_pair structures are used, and if successful
the result will represent exactly the specified range.
Using bio_chain_clone_range() makes bio_rq_fn() a little easier
to understand, because it avoids the need to pass very much
state information between consecutive calls. By avoiding the need
to track a bio_pair structure, it also eliminates the problem
described here: http://tracker.newdream.net/issues/2933
Note that a block request (and therefore the complete length of
a bio chain processed in rbd_rq_fn()) is an unsigned int, while
the result of rbd_segment_length() is u64. This change makes
this range trunctation explicit, and trips a bug if the the
segment boundary is too far off.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2012-10-20 22:17:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
rbd: simplify rbd_rq_fn()
When processing a request, rbd_rq_fn() makes clones of the bio's in
the request's bio chain and submits the results to osd's to be
satisfied. If a request bio straddles the boundary between objects
backing the rbd image, it must be represented by two cloned bio's,
one for the first part (at the end of one object) and one for the
second (at the beginning of the next object).
This has been handled by a function bio_chain_clone(), which
includes an interface only a mother could love, and which has
been found to have other problems.
This patch defines two new fairly generic bio functions (one which
replaces bio_chain_clone()) to help out the situation, and then
revises rbd_rq_fn() to make use of them.
First, bio_clone_range() clones a portion of a single bio, starting
at a given offset within the bio and including only as many bytes
as requested. As a convenience, a request to clone the entire bio
is passed directly to bio_clone().
Second, bio_chain_clone_range() performs a similar function,
producing a chain of cloned bio's covering a sub-range of the
source chain. No bio_pair structures are used, and if successful
the result will represent exactly the specified range.
Using bio_chain_clone_range() makes bio_rq_fn() a little easier
to understand, because it avoids the need to pass very much
state information between consecutive calls. By avoiding the need
to track a bio_pair structure, it also eliminates the problem
described here: http://tracker.newdream.net/issues/2933
Note that a block request (and therefore the complete length of
a bio chain processed in rbd_rq_fn()) is an unsigned int, while
the result of rbd_segment_length() is u64. This change makes
this range trunctation explicit, and trips a bug if the the
segment boundary is too far off.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2012-10-20 22:17:27 -05:00
|
|
|
|
2013-10-11 15:44:27 -07:00
|
|
|
|
rbd: simplify rbd_rq_fn()
When processing a request, rbd_rq_fn() makes clones of the bio's in
the request's bio chain and submits the results to osd's to be
satisfied. If a request bio straddles the boundary between objects
backing the rbd image, it must be represented by two cloned bio's,
one for the first part (at the end of one object) and one for the
second (at the beginning of the next object).
This has been handled by a function bio_chain_clone(), which
includes an interface only a mother could love, and which has
been found to have other problems.
This patch defines two new fairly generic bio functions (one which
replaces bio_chain_clone()) to help out the situation, and then
revises rbd_rq_fn() to make use of them.
First, bio_clone_range() clones a portion of a single bio, starting
at a given offset within the bio and including only as many bytes
as requested. As a convenience, a request to clone the entire bio
is passed directly to bio_clone().
Second, bio_chain_clone_range() performs a similar function,
producing a chain of cloned bio's covering a sub-range of the
source chain. No bio_pair structures are used, and if successful
the result will represent exactly the specified range.
Using bio_chain_clone_range() makes bio_rq_fn() a little easier
to understand, because it avoids the need to pass very much
state information between consecutive calls. By avoiding the need
to track a bio_pair structure, it also eliminates the problem
described here: http://tracker.newdream.net/issues/2933
Note that a block request (and therefore the complete length of
a bio chain processed in rbd_rq_fn()) is an unsigned int, while
the result of rbd_segment_length() is u64. This change makes
this range trunctation explicit, and trips a bug if the the
segment boundary is too far off.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2012-10-20 22:17:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
2014-07-11 12:11:20 +04:00
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
2014-07-11 12:11:20 +04:00
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-10 13:53:29 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
2013-02-20 17:32:08 -06:00
|
|
|
|
2016-11-14 17:29:48 +01:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-20 17:32:08 -06:00
|
|
|
|
2016-11-14 17:29:48 +01:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rbd: use reference counts for image requests
Each image request contains a reference count, but to date it has
not actually been used. (I think this was just an oversight.) A
recent report involving rbd failing an assertion shed light on why
and where we need to use these reference counts.
Every OSD request associated with an object request uses
rbd_osd_req_callback() as its callback function. That function will
call a helper function (dependent on the type of OSD request) that
will set the object request's "done" flag if the object request if
appropriate. If that "done" flag is set, the object request is
passed to rbd_obj_request_complete().
In rbd_obj_request_complete(), requests are processed in sequential
order. So if an object request completes before one of its
predecessors in the image request, the completion is deferred.
Otherwise, if it's a completing object's "turn" to be completed, it
is passed to rbd_img_obj_end_request(), which records the result of
the operation, accumulates transferred bytes, and so on. Next, the
successor to this request is checked and if it is marked "done",
(deferred) completion processing is performed on that request, and
so on. If the last object request in an image request is completed,
rbd_img_request_complete() is called, which (typically) destroys
the image request.
There is a race here, however. The instant an object request is
marked "done" it can be provided (by a thread handling completion of
one of its predecessor operations) to rbd_img_obj_end_request(),
which (for the last request) can then lead to the image request
getting torn down. And this can happen *before* that object has
itself entered rbd_img_obj_end_request(). As a result, once it
*does* enter that function, the image request (and even the object
request itself) may have been freed and become invalid.
All that's necessary to avoid this is to properly count references
to the image requests. We tear down an image request's object
requests all at once--only when the entire image request has
completed. So there's no need for an image request to count
references for its object requests. However, we don't want an
image request to go away until the last of its object requests
has passed through rbd_img_obj_callback(). In other words,
we don't want rbd_img_request_complete() to necessarily
result in the image request being destroyed, because it may
get called before we've finished processing on all of its
object requests.
So the fix is to add a reference to an image request for
each of its object requests. The reference can be viewed
as representing an object request that has not yet finished
its call to rbd_img_obj_callback(). That is emphasized by
getting the reference right after assigning that as the image
object's callback function. The corresponding release of that
reference is done at the end of rbd_img_obj_callback(), which
every image object request passes through exactly once.
Cc: stable@vger.kernel.org
Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Ilya Dryomov <ilya.dryomov@inktank.com>
2014-04-26 14:21:44 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-11-14 17:29:48 +01:00
|
|
|
|
rbd: use reference counts for image requests
Each image request contains a reference count, but to date it has
not actually been used. (I think this was just an oversight.) A
recent report involving rbd failing an assertion shed light on why
and where we need to use these reference counts.
Every OSD request associated with an object request uses
rbd_osd_req_callback() as its callback function. That function will
call a helper function (dependent on the type of OSD request) that
will set the object request's "done" flag if the object request if
appropriate. If that "done" flag is set, the object request is
passed to rbd_obj_request_complete().
In rbd_obj_request_complete(), requests are processed in sequential
order. So if an object request completes before one of its
predecessors in the image request, the completion is deferred.
Otherwise, if it's a completing object's "turn" to be completed, it
is passed to rbd_img_obj_end_request(), which records the result of
the operation, accumulates transferred bytes, and so on. Next, the
successor to this request is checked and if it is marked "done",
(deferred) completion processing is performed on that request, and
so on. If the last object request in an image request is completed,
rbd_img_request_complete() is called, which (typically) destroys
the image request.
There is a race here, however. The instant an object request is
marked "done" it can be provided (by a thread handling completion of
one of its predecessor operations) to rbd_img_obj_end_request(),
which (for the last request) can then lead to the image request
getting torn down. And this can happen *before* that object has
itself entered rbd_img_obj_end_request(). As a result, once it
*does* enter that function, the image request (and even the object
request itself) may have been freed and become invalid.
All that's necessary to avoid this is to properly count references
to the image requests. We tear down an image request's object
requests all at once--only when the entire image request has
completed. So there's no need for an image request to count
references for its object requests. However, we don't want an
image request to go away until the last of its object requests
has passed through rbd_img_obj_callback(). In other words,
we don't want rbd_img_request_complete() to necessarily
result in the image request being destroyed, because it may
get called before we've finished processing on all of its
object requests.
So the fix is to add a reference to an image request for
each of its object requests. The reference can be viewed
as representing an object request that has not yet finished
its call to rbd_img_obj_callback(). That is emphasized by
getting the reference right after assigning that as the image
object's callback function. The corresponding release of that
reference is done at the end of rbd_img_obj_callback(), which
every image object request passes through exactly once.
Cc: stable@vger.kernel.org
Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Ilya Dryomov <ilya.dryomov@inktank.com>
2014-04-26 14:21:44 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-08 22:50:04 -05:00
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-20 17:32:08 -06:00
|
|
|
|
2016-11-14 17:29:48 +01:00
|
|
|
|
2013-05-08 22:50:04 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-25 17:08:55 -06:00
|
|
|
|
|
|
|
|
|
2013-04-15 14:50:37 -05:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2013-01-25 17:08:55 -06:00
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2013-01-25 17:08:55 -06:00
|
|
|
|
|
|
|
|
|
2013-02-20 17:32:08 -06:00
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-25 17:08:55 -06:00
|
|
|
|
2013-02-20 17:32:08 -06:00
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2013-01-25 17:08:55 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
2013-01-25 17:08:55 -06:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-18 12:31:10 -06:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2013-01-17 12:25:27 -06:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-13 21:08:10 +02:00
|
|
|
|
|
|
|
|
|
2016-09-12 18:59:42 +02:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2016-09-12 18:59:42 +02:00
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:23 +01:00
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:22 +01:00
|
|
|
|
2016-09-13 21:08:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-12 18:59:42 +02:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-10 12:34:25 -05:00
|
|
|
|
2013-02-20 17:32:08 -06:00
|
|
|
|
2013-04-10 12:34:25 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-08 09:55:49 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-01 22:22:16 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-08 22:50:04 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-08 22:50:04 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-04 17:32:15 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-27 09:16:30 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-27 09:16:30 -05:00
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2013-03-27 09:16:30 -05:00
|
|
|
|
rbd: fix I/O error propagation for reads
When a request returns an error, the driver needs to report the entire
extent of the request as completed. Writes already did this, since
they always set xferred = length, but reads were skipping that step if
an error other than -ENOENT occurred. Instead, rbd would end up
passing 0 xferred to blk_end_request(), which would always report
needing more data. This resulted in an assert failing when more data
was required by the block layer, but all the object requests were
done:
[ 1868.719077] rbd: obj_request read result -108 xferred 0
[ 1868.719077]
[ 1868.719518] end_request: I/O error, dev rbd1, sector 0
[ 1868.719739]
[ 1868.719739] Assertion failure in rbd_img_obj_callback() at line 1736:
[ 1868.719739]
[ 1868.719739] rbd_assert(more ^ (which == img_request->obj_request_count));
Without this assert, reads that hit errors would hang forever, since
the block layer considered them incomplete.
Fixes: http://tracker.ceph.com/issues/5647
CC: stable@vger.kernel.org # v3.10
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Reviewed-by: Alex Elder <alex.elder@linaro.org>
2013-08-26 17:55:38 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-27 09:16:30 -05:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2013-03-27 09:16:30 -05:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-27 09:16:30 -05:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-27 09:16:30 -05:00
|
|
|
|
rbd: fix I/O error propagation for reads
When a request returns an error, the driver needs to report the entire
extent of the request as completed. Writes already did this, since
they always set xferred = length, but reads were skipping that step if
an error other than -ENOENT occurred. Instead, rbd would end up
passing 0 xferred to blk_end_request(), which would always report
needing more data. This resulted in an assert failing when more data
was required by the block layer, but all the object requests were
done:
[ 1868.719077] rbd: obj_request read result -108 xferred 0
[ 1868.719077]
[ 1868.719518] end_request: I/O error, dev rbd1, sector 0
[ 1868.719739]
[ 1868.719739] Assertion failure in rbd_img_obj_callback() at line 1736:
[ 1868.719739]
[ 1868.719739] rbd_assert(more ^ (which == img_request->obj_request_count));
Without this assert, reads that hit errors would hang forever, since
the block layer considered them incomplete.
Fixes: http://tracker.ceph.com/issues/5647
CC: stable@vger.kernel.org # v3.10
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Reviewed-by: Alex Elder <alex.elder@linaro.org>
2013-08-26 17:55:38 -07:00
|
|
|
|
2013-03-27 09:16:30 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
2013-02-20 17:32:08 -06:00
|
|
|
|
|
|
|
|
|
2018-01-15 17:24:51 +01:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
2016-09-26 15:43:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-26 14:23:07 -06:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
2013-04-21 00:32:07 -05:00
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-21 00:32:07 -05:00
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-21 00:32:07 -05:00
|
|
|
|
|
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
|
|
|
|
|
2013-03-27 09:16:30 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
2013-02-26 14:23:07 -06:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2013-02-25 16:11:12 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
|
|
|
|
|
2013-02-25 16:11:12 -08:00
|
|
|
|
|
|
|
|
|
2013-02-05 23:41:50 -06:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
2014-04-01 22:22:16 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-07 16:54:10 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-01 22:22:16 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-08 09:55:48 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-26 14:23:07 -06:00
|
|
|
|
2013-02-08 09:55:48 -06:00
|
|
|
|
2013-02-20 17:32:08 -06:00
|
|
|
|
2013-02-08 09:55:48 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rbd: fix copyup completion race
For write/discard obj_requests that involved a copyup method call, the
opcode of the first op is CEPH_OSD_OP_CALL and the ->callback is
rbd_img_obj_copyup_callback(). The latter frees copyup pages, sets
->xferred and delegates to rbd_img_obj_callback(), the "normal" image
object callback, for reporting to block layer and putting refs.
rbd_osd_req_callback() however treats CEPH_OSD_OP_CALL as a trivial op,
which means obj_request is marked done in rbd_osd_trivial_callback(),
*before* ->callback is invoked and rbd_img_obj_copyup_callback() has
a chance to run. Marking obj_request done essentially means giving
rbd_img_obj_callback() a license to end it at any moment, so if another
obj_request from the same img_request is being completed concurrently,
rbd_img_obj_end_request() may very well be called on such prematurally
marked done request:
<obj_request-1/2 reply>
handle_reply()
rbd_osd_req_callback()
rbd_osd_trivial_callback()
rbd_obj_request_complete()
rbd_img_obj_copyup_callback()
rbd_img_obj_callback()
<obj_request-2/2 reply>
handle_reply()
rbd_osd_req_callback()
rbd_osd_trivial_callback()
for_each_obj_request(obj_request->img_request) {
rbd_img_obj_end_request(obj_request-1/2)
rbd_img_obj_end_request(obj_request-2/2) <--
}
Calling rbd_img_obj_end_request() on such a request leads to trouble,
in particular because its ->xfferred is 0. We report 0 to the block
layer with blk_update_request(), get back 1 for "this request has more
data in flight" and then trip on
rbd_assert(more ^ (which == img_request->obj_request_count));
with rhs (which == ...) being 1 because rbd_img_obj_end_request() has
been called for both requests and lhs (more) being 1 because we haven't
got a chance to set ->xfferred in rbd_img_obj_copyup_callback() yet.
To fix this, leverage that rbd wants to call class methods in only two
cases: one is a generic method call wrapper (obj_request is standalone)
and the other is a copyup (obj_request is part of an img_request). So
make a dedicated handler for CEPH_OSD_OP_CALL and directly invoke
rbd_img_obj_copyup_callback() from it if obj_request is part of an
img_request, similar to how CEPH_OSD_OP_READ handler invokes
rbd_img_obj_request_read_callback().
Since rbd_img_obj_copyup_callback() is now being called from the OSD
request callback (only), it is renamed to rbd_osd_copyup_callback().
Cc: Alex Elder <elder@linaro.org>
Cc: stable@vger.kernel.org # 3.10+, needs backporting for < 3.18
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Alex Elder <elder@linaro.org>
2015-07-16 17:36:11 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-04-28 16:07:24 +02:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-04-28 16:07:24 +02:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2013-02-25 16:11:12 -08:00
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2013-02-26 14:23:07 -06:00
|
|
|
|
|
|
|
|
|
2015-01-13 17:20:04 +01:00
|
|
|
|
|
|
|
|
|
2013-02-26 14:23:07 -06:00
|
|
|
|
2016-01-07 16:48:57 +08:00
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
2014-02-25 16:22:28 +02:00
|
|
|
|
2013-04-03 21:32:51 -05:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
2013-02-26 14:23:07 -06:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2014-02-25 16:22:28 +02:00
|
|
|
|
2015-10-07 17:27:17 +02:00
|
|
|
|
|
|
|
|
|
2014-02-25 16:22:28 +02:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2015-10-07 17:27:17 +02:00
|
|
|
|
2013-02-26 14:23:07 -06:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2013-02-08 09:55:48 -06:00
|
|
|
|
2013-02-26 14:23:07 -06:00
|
|
|
|
2013-02-08 09:55:48 -06:00
|
|
|
|
2014-04-01 22:22:16 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-19 00:30:28 -06:00
|
|
|
|
rbd: fix copyup completion race
For write/discard obj_requests that involved a copyup method call, the
opcode of the first op is CEPH_OSD_OP_CALL and the ->callback is
rbd_img_obj_copyup_callback(). The latter frees copyup pages, sets
->xferred and delegates to rbd_img_obj_callback(), the "normal" image
object callback, for reporting to block layer and putting refs.
rbd_osd_req_callback() however treats CEPH_OSD_OP_CALL as a trivial op,
which means obj_request is marked done in rbd_osd_trivial_callback(),
*before* ->callback is invoked and rbd_img_obj_copyup_callback() has
a chance to run. Marking obj_request done essentially means giving
rbd_img_obj_callback() a license to end it at any moment, so if another
obj_request from the same img_request is being completed concurrently,
rbd_img_obj_end_request() may very well be called on such prematurally
marked done request:
<obj_request-1/2 reply>
handle_reply()
rbd_osd_req_callback()
rbd_osd_trivial_callback()
rbd_obj_request_complete()
rbd_img_obj_copyup_callback()
rbd_img_obj_callback()
<obj_request-2/2 reply>
handle_reply()
rbd_osd_req_callback()
rbd_osd_trivial_callback()
for_each_obj_request(obj_request->img_request) {
rbd_img_obj_end_request(obj_request-1/2)
rbd_img_obj_end_request(obj_request-2/2) <--
}
Calling rbd_img_obj_end_request() on such a request leads to trouble,
in particular because its ->xfferred is 0. We report 0 to the block
layer with blk_update_request(), get back 1 for "this request has more
data in flight" and then trip on
rbd_assert(more ^ (which == img_request->obj_request_count));
with rhs (which == ...) being 1 because rbd_img_obj_end_request() has
been called for both requests and lhs (more) being 1 because we haven't
got a chance to set ->xfferred in rbd_img_obj_copyup_callback() yet.
To fix this, leverage that rbd wants to call class methods in only two
cases: one is a generic method call wrapper (obj_request is standalone)
and the other is a copyup (obj_request is part of an img_request). So
make a dedicated handler for CEPH_OSD_OP_CALL and directly invoke
rbd_img_obj_copyup_callback() from it if obj_request is part of an
img_request, similar to how CEPH_OSD_OP_READ handler invokes
rbd_img_obj_request_read_callback().
Since rbd_img_obj_copyup_callback() is now being called from the OSD
request callback (only), it is renamed to rbd_osd_copyup_callback().
Cc: Alex Elder <elder@linaro.org>
Cc: stable@vger.kernel.org # 3.10+, needs backporting for < 3.18
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Alex Elder <elder@linaro.org>
2015-07-16 17:36:11 +03:00
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2017-01-25 18:16:23 +01:00
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-05 23:41:50 -06:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2013-04-03 21:32:51 -05:00
|
|
|
|
2013-04-03 01:28:58 -05:00
|
|
|
|
2013-04-03 21:32:51 -05:00
|
|
|
|
2016-09-15 17:56:39 +02:00
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-08 15:59:19 -07:00
|
|
|
|
2016-05-26 00:29:52 +02:00
|
|
|
|
2013-04-03 21:32:51 -05:00
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:23 +01:00
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:23 +01:00
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-02-25 16:22:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
2014-03-13 11:21:35 +08:00
|
|
|
|
2014-02-25 16:22:27 +02:00
|
|
|
|
2013-04-03 21:32:51 -05:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-01 22:22:16 +08:00
|
|
|
|
|
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
2014-04-01 22:22:16 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-03-13 11:21:35 +08:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
2014-03-13 11:21:35 +08:00
|
|
|
|
2014-02-25 16:22:27 +02:00
|
|
|
|
2017-01-25 18:16:23 +01:00
|
|
|
|
|
|
|
|
|
2017-02-11 18:48:41 +01:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2014-04-07 16:49:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-07 16:49:21 -07:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-07 16:49:21 -07:00
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2014-04-07 16:49:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:23 +01:00
|
|
|
|
|
|
|
|
|
2017-02-11 18:48:41 +01:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:23 +01:00
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-24 17:24:33 +03:00
|
|
|
|
2017-01-25 18:16:23 +01:00
|
|
|
|
2013-05-01 12:43:03 -05:00
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:22 +01:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-20 17:32:08 -06:00
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-18 12:31:10 -06:00
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-17 12:25:27 -06:00
|
|
|
|
2016-09-15 18:05:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-17 12:25:27 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
2013-05-01 12:43:03 -05:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
2013-05-08 22:50:04 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-08 22:50:04 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-11 12:11:20 +04:00
|
|
|
|
2013-05-08 22:50:04 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-19 18:13:43 +03:00
|
|
|
|
2013-05-08 22:50:04 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-19 18:13:43 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-08 22:50:04 -05:00
|
|
|
|
|
|
|
|
|
2014-07-11 12:11:20 +04:00
|
|
|
|
2013-05-08 22:50:04 -05:00
|
|
|
|
2015-01-19 18:13:43 +03:00
|
|
|
|
2013-05-08 22:50:04 -05:00
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-19 12:25:56 -06:00
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2014-03-13 11:21:35 +08:00
|
|
|
|
2014-04-08 11:12:11 -07:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-22 16:03:06 +01:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-01 22:22:16 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-08 09:55:49 -06:00
|
|
|
|
2014-04-08 11:12:11 -07:00
|
|
|
|
2013-02-08 09:55:49 -06:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2013-02-08 09:55:49 -06:00
|
|
|
|
2013-05-08 22:50:04 -05:00
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
2018-01-22 16:03:06 +01:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-20 17:32:08 -06:00
|
|
|
|
2014-03-13 11:21:35 +08:00
|
|
|
|
2013-02-20 17:32:08 -06:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-20 17:32:08 -06:00
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
2013-01-25 17:08:55 -06:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2013-05-08 22:50:04 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-04 17:47:52 -07:00
|
|
|
|
|
|
|
|
|
2013-04-30 00:44:32 -05:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2013-05-01 12:43:03 -05:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
2013-05-08 22:50:04 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-08 11:12:11 -07:00
|
|
|
|
2014-03-13 11:21:35 +08:00
|
|
|
|
2013-05-08 22:50:04 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-08 09:55:49 -06:00
|
|
|
|
|
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
2013-02-08 09:55:49 -06:00
|
|
|
|
|
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
2013-02-08 09:55:49 -06:00
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-08 09:55:49 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-03-13 11:21:35 +08:00
|
|
|
|
|
|
|
|
|
2014-04-01 22:22:16 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-08 09:55:49 -06:00
|
|
|
|
2014-07-11 12:11:20 +04:00
|
|
|
|
2014-03-13 11:21:35 +08:00
|
|
|
|
|
|
|
|
|
2014-07-11 12:11:20 +04:00
|
|
|
|
2013-02-08 09:55:49 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-25 15:56:15 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-08 09:55:49 -06:00
|
|
|
|
|
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-03 09:38:04 +02:00
|
|
|
|
|
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
2015-01-13 17:20:04 +01:00
|
|
|
|
2017-06-03 09:38:04 +02:00
|
|
|
|
2015-01-13 17:20:04 +01:00
|
|
|
|
2017-06-03 09:38:04 +02:00
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-08 09:55:49 -06:00
|
|
|
|
|
|
|
|
|
2013-04-05 01:27:12 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
2013-04-05 01:27:12 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-08 09:55:49 -06:00
|
|
|
|
2013-04-05 01:27:12 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rbd: use reference counts for image requests
Each image request contains a reference count, but to date it has
not actually been used. (I think this was just an oversight.) A
recent report involving rbd failing an assertion shed light on why
and where we need to use these reference counts.
Every OSD request associated with an object request uses
rbd_osd_req_callback() as its callback function. That function will
call a helper function (dependent on the type of OSD request) that
will set the object request's "done" flag if the object request if
appropriate. If that "done" flag is set, the object request is
passed to rbd_obj_request_complete().
In rbd_obj_request_complete(), requests are processed in sequential
order. So if an object request completes before one of its
predecessors in the image request, the completion is deferred.
Otherwise, if it's a completing object's "turn" to be completed, it
is passed to rbd_img_obj_end_request(), which records the result of
the operation, accumulates transferred bytes, and so on. Next, the
successor to this request is checked and if it is marked "done",
(deferred) completion processing is performed on that request, and
so on. If the last object request in an image request is completed,
rbd_img_request_complete() is called, which (typically) destroys
the image request.
There is a race here, however. The instant an object request is
marked "done" it can be provided (by a thread handling completion of
one of its predecessor operations) to rbd_img_obj_end_request(),
which (for the last request) can then lead to the image request
getting torn down. And this can happen *before* that object has
itself entered rbd_img_obj_end_request(). As a result, once it
*does* enter that function, the image request (and even the object
request itself) may have been freed and become invalid.
All that's necessary to avoid this is to properly count references
to the image requests. We tear down an image request's object
requests all at once--only when the entire image request has
completed. So there's no need for an image request to count
references for its object requests. However, we don't want an
image request to go away until the last of its object requests
has passed through rbd_img_obj_callback(). In other words,
we don't want rbd_img_request_complete() to necessarily
result in the image request being destroyed, because it may
get called before we've finished processing on all of its
object requests.
So the fix is to add a reference to an image request for
each of its object requests. The reference can be viewed
as representing an object request that has not yet finished
its call to rbd_img_obj_callback(). That is emphasized by
getting the reference right after assigning that as the image
object's callback function. The corresponding release of that
reference is done at the end of rbd_img_obj_callback(), which
every image object request passes through exactly once.
Cc: stable@vger.kernel.org
Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Ilya Dryomov <ilya.dryomov@inktank.com>
2014-04-26 14:21:44 +04:00
|
|
|
|
2013-04-05 01:27:12 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-04 17:32:15 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-07 16:49:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-04 17:32:15 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-07 17:27:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-04 17:32:15 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-11-21 22:16:43 +03:00
|
|
|
|
2015-04-27 11:09:54 +08:00
|
|
|
|
2014-11-21 22:16:43 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-04 17:32:15 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-09 13:04:35 +09:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2013-08-09 13:04:35 +09:00
|
|
|
|
2014-03-13 11:21:35 +08:00
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
2013-02-20 17:32:08 -06:00
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2013-02-20 21:59:33 -06:00
|
|
|
|
2014-04-04 17:32:15 -07:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-10-11 15:44:27 -07:00
|
|
|
|
|
|
|
|
|
2014-04-01 22:22:16 +08:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2013-04-05 01:27:12 -05:00
|
|
|
|
2017-01-25 18:16:23 +01:00
|
|
|
|
2017-01-25 18:16:22 +01:00
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2017-01-25 18:16:23 +01:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
2014-03-04 11:57:17 +02:00
|
|
|
|
2017-01-25 18:16:23 +01:00
|
|
|
|
2017-01-25 18:16:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-27 14:45:46 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-04-05 11:13:39 +02:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2014-03-04 11:57:17 +02:00
|
|
|
|
2014-04-01 22:22:16 +08:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2014-03-13 11:21:35 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-05 01:27:12 -05:00
|
|
|
|
2014-03-04 11:57:17 +02:00
|
|
|
|
2014-04-04 17:32:15 -07:00
|
|
|
|
2013-04-05 01:27:12 -05:00
|
|
|
|
2013-04-05 01:27:12 -05:00
|
|
|
|
2014-04-04 17:32:15 -07:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2014-04-04 17:32:15 -07:00
|
|
|
|
2013-04-03 21:32:51 -05:00
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-03-04 11:57:17 +02:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
rbd: fix copyup completion race
For write/discard obj_requests that involved a copyup method call, the
opcode of the first op is CEPH_OSD_OP_CALL and the ->callback is
rbd_img_obj_copyup_callback(). The latter frees copyup pages, sets
->xferred and delegates to rbd_img_obj_callback(), the "normal" image
object callback, for reporting to block layer and putting refs.
rbd_osd_req_callback() however treats CEPH_OSD_OP_CALL as a trivial op,
which means obj_request is marked done in rbd_osd_trivial_callback(),
*before* ->callback is invoked and rbd_img_obj_copyup_callback() has
a chance to run. Marking obj_request done essentially means giving
rbd_img_obj_callback() a license to end it at any moment, so if another
obj_request from the same img_request is being completed concurrently,
rbd_img_obj_end_request() may very well be called on such prematurally
marked done request:
<obj_request-1/2 reply>
handle_reply()
rbd_osd_req_callback()
rbd_osd_trivial_callback()
rbd_obj_request_complete()
rbd_img_obj_copyup_callback()
rbd_img_obj_callback()
<obj_request-2/2 reply>
handle_reply()
rbd_osd_req_callback()
rbd_osd_trivial_callback()
for_each_obj_request(obj_request->img_request) {
rbd_img_obj_end_request(obj_request-1/2)
rbd_img_obj_end_request(obj_request-2/2) <--
}
Calling rbd_img_obj_end_request() on such a request leads to trouble,
in particular because its ->xfferred is 0. We report 0 to the block
layer with blk_update_request(), get back 1 for "this request has more
data in flight" and then trip on
rbd_assert(more ^ (which == img_request->obj_request_count));
with rhs (which == ...) being 1 because rbd_img_obj_end_request() has
been called for both requests and lhs (more) being 1 because we haven't
got a chance to set ->xfferred in rbd_img_obj_copyup_callback() yet.
To fix this, leverage that rbd wants to call class methods in only two
cases: one is a generic method call wrapper (obj_request is standalone)
and the other is a copyup (obj_request is part of an img_request). So
make a dedicated handler for CEPH_OSD_OP_CALL and directly invoke
rbd_img_obj_copyup_callback() from it if obj_request is part of an
img_request, similar to how CEPH_OSD_OP_READ handler invokes
rbd_img_obj_request_read_callback().
Since rbd_img_obj_copyup_callback() is now being called from the OSD
request callback (only), it is renamed to rbd_osd_copyup_callback().
Cc: Alex Elder <elder@linaro.org>
Cc: stable@vger.kernel.org # 3.10+, needs backporting for < 3.18
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Alex Elder <elder@linaro.org>
2015-07-16 17:36:11 +03:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-10 16:29:22 -05:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
rbd: fix copyup completion race
For write/discard obj_requests that involved a copyup method call, the
opcode of the first op is CEPH_OSD_OP_CALL and the ->callback is
rbd_img_obj_copyup_callback(). The latter frees copyup pages, sets
->xferred and delegates to rbd_img_obj_callback(), the "normal" image
object callback, for reporting to block layer and putting refs.
rbd_osd_req_callback() however treats CEPH_OSD_OP_CALL as a trivial op,
which means obj_request is marked done in rbd_osd_trivial_callback(),
*before* ->callback is invoked and rbd_img_obj_copyup_callback() has
a chance to run. Marking obj_request done essentially means giving
rbd_img_obj_callback() a license to end it at any moment, so if another
obj_request from the same img_request is being completed concurrently,
rbd_img_obj_end_request() may very well be called on such prematurally
marked done request:
<obj_request-1/2 reply>
handle_reply()
rbd_osd_req_callback()
rbd_osd_trivial_callback()
rbd_obj_request_complete()
rbd_img_obj_copyup_callback()
rbd_img_obj_callback()
<obj_request-2/2 reply>
handle_reply()
rbd_osd_req_callback()
rbd_osd_trivial_callback()
for_each_obj_request(obj_request->img_request) {
rbd_img_obj_end_request(obj_request-1/2)
rbd_img_obj_end_request(obj_request-2/2) <--
}
Calling rbd_img_obj_end_request() on such a request leads to trouble,
in particular because its ->xfferred is 0. We report 0 to the block
layer with blk_update_request(), get back 1 for "this request has more
data in flight" and then trip on
rbd_assert(more ^ (which == img_request->obj_request_count));
with rhs (which == ...) being 1 because rbd_img_obj_end_request() has
been called for both requests and lhs (more) being 1 because we haven't
got a chance to set ->xfferred in rbd_img_obj_copyup_callback() yet.
To fix this, leverage that rbd wants to call class methods in only two
cases: one is a generic method call wrapper (obj_request is standalone)
and the other is a copyup (obj_request is part of an img_request). So
make a dedicated handler for CEPH_OSD_OP_CALL and directly invoke
rbd_img_obj_copyup_callback() from it if obj_request is part of an
img_request, similar to how CEPH_OSD_OP_READ handler invokes
rbd_img_obj_request_read_callback().
Since rbd_img_obj_copyup_callback() is now being called from the OSD
request callback (only), it is renamed to rbd_osd_copyup_callback().
Cc: Alex Elder <elder@linaro.org>
Cc: stable@vger.kernel.org # 3.10+, needs backporting for < 3.18
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Alex Elder <elder@linaro.org>
2015-07-16 17:36:11 +03:00
|
|
|
|
|
|
|
|
|
2014-04-07 16:49:21 -07:00
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-10 16:29:22 -05:00
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2013-05-10 16:29:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rbd: fix copyup completion race
For write/discard obj_requests that involved a copyup method call, the
opcode of the first op is CEPH_OSD_OP_CALL and the ->callback is
rbd_img_obj_copyup_callback(). The latter frees copyup pages, sets
->xferred and delegates to rbd_img_obj_callback(), the "normal" image
object callback, for reporting to block layer and putting refs.
rbd_osd_req_callback() however treats CEPH_OSD_OP_CALL as a trivial op,
which means obj_request is marked done in rbd_osd_trivial_callback(),
*before* ->callback is invoked and rbd_img_obj_copyup_callback() has
a chance to run. Marking obj_request done essentially means giving
rbd_img_obj_callback() a license to end it at any moment, so if another
obj_request from the same img_request is being completed concurrently,
rbd_img_obj_end_request() may very well be called on such prematurally
marked done request:
<obj_request-1/2 reply>
handle_reply()
rbd_osd_req_callback()
rbd_osd_trivial_callback()
rbd_obj_request_complete()
rbd_img_obj_copyup_callback()
rbd_img_obj_callback()
<obj_request-2/2 reply>
handle_reply()
rbd_osd_req_callback()
rbd_osd_trivial_callback()
for_each_obj_request(obj_request->img_request) {
rbd_img_obj_end_request(obj_request-1/2)
rbd_img_obj_end_request(obj_request-2/2) <--
}
Calling rbd_img_obj_end_request() on such a request leads to trouble,
in particular because its ->xfferred is 0. We report 0 to the block
layer with blk_update_request(), get back 1 for "this request has more
data in flight" and then trip on
rbd_assert(more ^ (which == img_request->obj_request_count));
with rhs (which == ...) being 1 because rbd_img_obj_end_request() has
been called for both requests and lhs (more) being 1 because we haven't
got a chance to set ->xfferred in rbd_img_obj_copyup_callback() yet.
To fix this, leverage that rbd wants to call class methods in only two
cases: one is a generic method call wrapper (obj_request is standalone)
and the other is a copyup (obj_request is part of an img_request). So
make a dedicated handler for CEPH_OSD_OP_CALL and directly invoke
rbd_img_obj_copyup_callback() from it if obj_request is part of an
img_request, similar to how CEPH_OSD_OP_READ handler invokes
rbd_img_obj_request_read_callback().
Since rbd_img_obj_copyup_callback() is now being called from the OSD
request callback (only), it is renamed to rbd_osd_copyup_callback().
Cc: Alex Elder <elder@linaro.org>
Cc: stable@vger.kernel.org # 3.10+, needs backporting for < 3.18
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Alex Elder <elder@linaro.org>
2015-07-16 17:36:11 +03:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2014-04-07 16:49:21 -07:00
|
|
|
|
2013-05-10 16:29:22 -05:00
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
2013-05-10 16:29:22 -05:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-10 16:29:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-10 16:29:22 -05:00
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
2013-05-10 16:29:22 -05:00
|
|
|
|
2016-09-16 15:20:42 +02:00
|
|
|
|
2013-05-06 17:40:32 -05:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2013-05-06 17:40:32 -05:00
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-12 18:59:42 +02:00
|
|
|
|
|
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
2013-05-09 10:08:49 -05:00
|
|
|
|
|
|
|
|
|
2014-02-25 16:22:28 +02:00
|
|
|
|
2013-05-09 10:08:49 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-09 10:08:49 -05:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
2013-05-10 16:29:22 -05:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2013-05-10 16:29:22 -05:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2014-04-07 16:49:21 -07:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2014-04-07 16:49:21 -07:00
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-12 18:59:42 +02:00
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
2016-09-16 15:20:42 +02:00
|
|
|
|
2016-09-26 15:43:52 +02:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-13 20:18:01 +02:00
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-12 14:44:45 +02:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:22 +01:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2013-04-21 00:32:07 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-11-06 11:33:36 +01:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-08 22:50:04 -05:00
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-12 14:44:45 +02:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2013-05-10 16:29:22 -05:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2016-09-12 14:44:45 +02:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-10 16:29:22 -05:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-13 20:35:38 -05:00
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
|
|
|
|
|
2016-09-12 18:59:42 +02:00
|
|
|
|
|
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-12 18:59:42 +02:00
|
|
|
|
|
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-13 20:18:01 +02:00
|
|
|
|
|
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-13 20:18:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-26 15:43:52 +02:00
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-12 14:44:45 +02:00
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
2016-09-15 17:53:32 +02:00
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:23 +01:00
|
|
|
|
2016-09-15 17:53:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:23 +01:00
|
|
|
|
|
|
|
|
|
2016-09-15 17:53:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-11-06 11:33:36 +01:00
|
|
|
|
2016-09-15 17:53:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
2016-09-15 17:53:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-12 18:59:42 +02:00
|
|
|
|
|
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
2016-09-15 17:53:32 +02:00
|
|
|
|
|
|
|
|
|
2013-02-11 12:33:24 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-12 16:02:01 +04:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2016-09-12 14:44:45 +02:00
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2014-09-12 16:02:01 +04:00
|
|
|
|
2014-04-04 17:49:12 -07:00
|
|
|
|
|
|
|
|
|
2014-09-12 16:02:01 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2014-09-12 16:02:01 +04:00
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2014-09-12 16:02:01 +04:00
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2014-04-01 22:22:15 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-12 16:02:01 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-12 14:44:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2014-09-12 16:02:01 +04:00
|
|
|
|
2016-09-12 18:59:42 +02:00
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2014-09-12 16:02:01 +04:00
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-10 17:47:46 -05:00
|
|
|
|
2016-05-16 13:18:57 +02:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2013-02-20 17:32:08 -06:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2016-05-16 13:18:57 +02:00
|
|
|
|
|
|
|
|
|
2013-04-19 15:34:50 -05:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2016-05-16 13:18:57 +02:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
2016-05-16 13:18:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-21 00:32:07 -05:00
|
|
|
|
|
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
|
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
|
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-21 00:32:07 -05:00
|
|
|
|
|
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
|
|
|
|
|
2016-09-12 18:59:42 +02:00
|
|
|
|
|
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
2013-04-21 00:32:07 -05:00
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
2013-04-21 00:32:07 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
2013-04-21 00:32:07 -05:00
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
2013-04-21 00:32:07 -05:00
|
|
|
|
|
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
|
|
|
|
|
2013-05-08 22:50:04 -05:00
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
2013-05-08 22:50:04 -05:00
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-24 16:13:36 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
2012-11-30 17:53:04 -06:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-12-13 16:43:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-30 17:53:04 -06:00
|
|
|
|
2016-05-26 01:15:02 +02:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
2013-05-06 07:40:30 -05:00
|
|
|
|
2012-11-30 17:53:04 -06:00
|
|
|
|
2017-04-13 12:17:38 +02:00
|
|
|
|
|
|
|
|
|
2014-07-23 17:11:20 +04:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-06 07:40:30 -05:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
2012-11-30 17:53:04 -06:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
2017-12-13 16:43:59 +01:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
2012-11-30 17:53:04 -06:00
|
|
|
|
|
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-13 12:17:38 +02:00
|
|
|
|
2014-06-19 11:38:14 +04:00
|
|
|
|
2016-05-26 01:15:02 +02:00
|
|
|
|
2014-06-19 11:38:14 +04:00
|
|
|
|
|
|
|
|
|
2017-04-13 12:17:38 +02:00
|
|
|
|
|
|
|
|
|
2014-06-19 11:38:14 +04:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
2017-04-13 12:17:38 +02:00
|
|
|
|
2017-04-13 12:17:38 +02:00
|
|
|
|
|
|
|
|
|
2014-06-19 11:38:14 +04:00
|
|
|
|
2017-04-13 12:17:38 +02:00
|
|
|
|
|
|
|
|
|
2017-04-13 12:17:38 +02:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
2014-06-19 11:38:14 +04:00
|
|
|
|
|
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-18 12:31:10 -06:00
|
|
|
|
|
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-18 12:31:10 -06:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
2013-01-18 12:31:10 -06:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-25 17:08:55 -06:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-05-22 19:28:52 +04:00
|
|
|
|
|
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
2014-05-22 19:28:52 +04:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
2014-05-22 19:28:52 +04:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-05-22 19:28:52 +04:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-20 18:29:20 +04:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
2016-04-28 16:07:26 +02:00
|
|
|
|
|
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
2016-04-28 16:07:26 +02:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
rbd: fix rbd map vs notify races
A while ago, commit 9875201e1049 ("rbd: fix use-after free of
rbd_dev->disk") fixed rbd unmap vs notify race by introducing
an exported wrapper for flushing notifies and sticking it into
do_rbd_remove().
A similar problem exists on the rbd map path, though: the watch is
registered in rbd_dev_image_probe(), while the disk is set up quite
a few steps later, in rbd_dev_device_setup(). Nothing prevents
a notify from coming in and crashing on a NULL rbd_dev->disk:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000050
Call Trace:
[<ffffffffa0508344>] rbd_watch_cb+0x34/0x180 [rbd]
[<ffffffffa04bd290>] do_event_work+0x40/0xb0 [libceph]
[<ffffffff8109d5db>] process_one_work+0x17b/0x470
[<ffffffff8109e3ab>] worker_thread+0x11b/0x400
[<ffffffff8109e290>] ? rescuer_thread+0x400/0x400
[<ffffffff810a5acf>] kthread+0xcf/0xe0
[<ffffffff810b41b3>] ? finish_task_switch+0x53/0x170
[<ffffffff810a5a00>] ? kthread_create_on_node+0x140/0x140
[<ffffffff81645dd8>] ret_from_fork+0x58/0x90
[<ffffffff810a5a00>] ? kthread_create_on_node+0x140/0x140
RIP [<ffffffffa050828a>] rbd_dev_refresh+0xfa/0x180 [rbd]
If an error occurs during rbd map, we have to error out, potentially
tearing down a watch. Just like on rbd unmap, notifies have to be
flushed, otherwise rbd_watch_cb() may end up trying to read in the
image header after rbd_dev_image_release() has run:
Assertion failure in rbd_dev_header_info() at line 4722:
rbd_assert(rbd_image_format_valid(rbd_dev->image_format));
Call Trace:
[<ffffffff81cccee0>] ? rbd_parent_request_create+0x150/0x150
[<ffffffff81cd4e59>] rbd_dev_refresh+0x59/0x390
[<ffffffff81cd5229>] rbd_watch_cb+0x69/0x290
[<ffffffff81fde9bf>] do_event_work+0x10f/0x1c0
[<ffffffff81107799>] process_one_work+0x689/0x1a80
[<ffffffff811076f7>] ? process_one_work+0x5e7/0x1a80
[<ffffffff81132065>] ? finish_task_switch+0x225/0x640
[<ffffffff81107110>] ? pwq_dec_nr_in_flight+0x2b0/0x2b0
[<ffffffff81108c69>] worker_thread+0xd9/0x1320
[<ffffffff81108b90>] ? process_one_work+0x1a80/0x1a80
[<ffffffff8111b02d>] kthread+0x21d/0x2e0
[<ffffffff8111ae10>] ? kthread_stop+0x550/0x550
[<ffffffff82022802>] ret_from_fork+0x22/0x40
[<ffffffff8111ae10>] ? kthread_stop+0x550/0x550
RIP [<ffffffff81ccd8f9>] rbd_dev_header_info+0xa19/0x1e30
To fix this, a) check if RBD_DEV_FLAG_EXISTS is set before calling
revalidate_disk(), b) move ceph_osdc_flush_notifies() call into
rbd_dev_header_unwatch_sync() to cover rbd map error paths and c) turn
header read-in into a critical section. The latter also happens to
take care of rbd map foo@bar vs rbd snap rm foo@bar race.
Fixes: http://tracker.ceph.com/issues/15490
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2016-04-15 16:22:16 +02:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
2013-12-16 18:02:40 +02:00
|
|
|
|
|
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
2013-01-19 00:30:28 -06:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-19 00:30:28 -06:00
|
|
|
|
|
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
2013-01-19 00:30:28 -06:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-19 00:30:28 -06:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
2013-01-19 00:30:28 -06:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-19 00:30:28 -06:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-19 00:30:28 -06:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
2013-04-05 14:46:02 -05:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-13 15:46:35 +08:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-13 12:17:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-23 17:11:20 +04:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
2014-07-23 17:11:20 +04:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
2014-07-23 17:11:20 +04:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-13 12:17:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-13 12:17:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-13 12:17:39 +02:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-13 12:17:39 +02:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
2017-04-13 12:17:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-13 12:17:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
2017-04-13 12:17:39 +02:00
|
|
|
|
|
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
2017-04-13 12:17:39 +02:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-30 17:53:04 -06:00
|
|
|
|
2016-05-26 01:15:02 +02:00
|
|
|
|
|
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
2014-07-23 17:11:20 +04:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-06 11:15:48 +02:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-13 12:17:39 +02:00
|
|
|
|
|
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
2017-04-13 12:17:39 +02:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-30 17:53:04 -06:00
|
|
|
|
|
|
|
|
|
2016-08-12 16:11:41 +02:00
|
|
|
|
|
|
|
|
|
2016-05-26 01:15:02 +02:00
|
|
|
|
2014-06-19 11:38:14 +04:00
|
|
|
|
2016-05-26 01:15:02 +02:00
|
|
|
|
2014-06-19 11:38:14 +04:00
|
|
|
|
2016-05-26 01:15:02 +02:00
|
|
|
|
2014-06-19 11:38:14 +04:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-12 16:11:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-19 11:38:14 +04:00
|
|
|
|
2016-08-12 16:11:41 +02:00
|
|
|
|
2014-06-19 11:38:14 +04:00
|
|
|
|
2016-08-12 16:11:41 +02:00
|
|
|
|
2014-06-19 11:38:14 +04:00
|
|
|
|
|
|
|
|
|
2013-01-18 12:31:10 -06:00
|
|
|
|
2016-08-12 16:11:41 +02:00
|
|
|
|
2013-01-18 12:31:10 -06:00
|
|
|
|
2016-08-12 16:11:41 +02:00
|
|
|
|
2013-01-18 12:31:10 -06:00
|
|
|
|
|
|
|
|
|
2016-05-26 01:15:02 +02:00
|
|
|
|
2013-01-18 12:31:10 -06:00
|
|
|
|
2016-05-26 01:15:02 +02:00
|
|
|
|
2016-08-12 16:11:41 +02:00
|
|
|
|
2013-01-18 12:31:10 -06:00
|
|
|
|
2016-05-26 01:15:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-25 17:08:55 -06:00
|
|
|
|
2016-05-26 01:15:02 +02:00
|
|
|
|
2014-05-22 19:28:52 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-12 16:11:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-05-22 19:28:52 +04:00
|
|
|
|
2016-05-26 01:15:02 +02:00
|
|
|
|
|
|
|
|
|
2014-05-22 19:28:52 +04:00
|
|
|
|
2016-08-12 16:11:41 +02:00
|
|
|
|
|
|
|
|
|
2014-05-22 19:28:52 +04:00
|
|
|
|
2016-05-26 01:15:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-20 18:29:20 +04:00
|
|
|
|
2016-05-26 01:15:02 +02:00
|
|
|
|
2016-04-28 16:07:26 +02:00
|
|
|
|
|
|
|
|
|
2016-08-12 16:11:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-04-28 16:07:26 +02:00
|
|
|
|
2016-08-12 16:11:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-12 16:11:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
2016-08-12 16:11:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rbd: fix rbd map vs notify races
A while ago, commit 9875201e1049 ("rbd: fix use-after free of
rbd_dev->disk") fixed rbd unmap vs notify race by introducing
an exported wrapper for flushing notifies and sticking it into
do_rbd_remove().
A similar problem exists on the rbd map path, though: the watch is
registered in rbd_dev_image_probe(), while the disk is set up quite
a few steps later, in rbd_dev_device_setup(). Nothing prevents
a notify from coming in and crashing on a NULL rbd_dev->disk:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000050
Call Trace:
[<ffffffffa0508344>] rbd_watch_cb+0x34/0x180 [rbd]
[<ffffffffa04bd290>] do_event_work+0x40/0xb0 [libceph]
[<ffffffff8109d5db>] process_one_work+0x17b/0x470
[<ffffffff8109e3ab>] worker_thread+0x11b/0x400
[<ffffffff8109e290>] ? rescuer_thread+0x400/0x400
[<ffffffff810a5acf>] kthread+0xcf/0xe0
[<ffffffff810b41b3>] ? finish_task_switch+0x53/0x170
[<ffffffff810a5a00>] ? kthread_create_on_node+0x140/0x140
[<ffffffff81645dd8>] ret_from_fork+0x58/0x90
[<ffffffff810a5a00>] ? kthread_create_on_node+0x140/0x140
RIP [<ffffffffa050828a>] rbd_dev_refresh+0xfa/0x180 [rbd]
If an error occurs during rbd map, we have to error out, potentially
tearing down a watch. Just like on rbd unmap, notifies have to be
flushed, otherwise rbd_watch_cb() may end up trying to read in the
image header after rbd_dev_image_release() has run:
Assertion failure in rbd_dev_header_info() at line 4722:
rbd_assert(rbd_image_format_valid(rbd_dev->image_format));
Call Trace:
[<ffffffff81cccee0>] ? rbd_parent_request_create+0x150/0x150
[<ffffffff81cd4e59>] rbd_dev_refresh+0x59/0x390
[<ffffffff81cd5229>] rbd_watch_cb+0x69/0x290
[<ffffffff81fde9bf>] do_event_work+0x10f/0x1c0
[<ffffffff81107799>] process_one_work+0x689/0x1a80
[<ffffffff811076f7>] ? process_one_work+0x5e7/0x1a80
[<ffffffff81132065>] ? finish_task_switch+0x225/0x640
[<ffffffff81107110>] ? pwq_dec_nr_in_flight+0x2b0/0x2b0
[<ffffffff81108c69>] worker_thread+0xd9/0x1320
[<ffffffff81108b90>] ? process_one_work+0x1a80/0x1a80
[<ffffffff8111b02d>] kthread+0x21d/0x2e0
[<ffffffff8111ae10>] ? kthread_stop+0x550/0x550
[<ffffffff82022802>] ret_from_fork+0x22/0x40
[<ffffffff8111ae10>] ? kthread_stop+0x550/0x550
RIP [<ffffffff81ccd8f9>] rbd_dev_header_info+0xa19/0x1e30
To fix this, a) check if RBD_DEV_FLAG_EXISTS is set before calling
revalidate_disk(), b) move ceph_osdc_flush_notifies() call into
rbd_dev_header_unwatch_sync() to cover rbd map error paths and c) turn
header read-in into a critical section. The latter also happens to
take care of rbd map foo@bar vs rbd snap rm foo@bar race.
Fixes: http://tracker.ceph.com/issues/15490
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2016-04-15 16:22:16 +02:00
|
|
|
|
|
|
|
|
|
2013-12-16 18:02:40 +02:00
|
|
|
|
|
|
|
|
|
2017-04-13 12:17:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-12-13 16:43:59 +01:00
|
|
|
|
2017-04-13 12:17:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-12 16:11:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-29 13:41:05 +02:00
|
|
|
|
|
|
|
|
|
2017-04-13 12:17:38 +02:00
|
|
|
|
2016-09-29 13:41:05 +02:00
|
|
|
|
2016-08-12 16:11:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-29 14:23:12 +02:00
|
|
|
|
2016-09-29 13:41:05 +02:00
|
|
|
|
2017-04-13 12:17:38 +02:00
|
|
|
|
2016-09-29 13:41:05 +02:00
|
|
|
|
2016-08-12 16:11:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-29 13:41:05 +02:00
|
|
|
|
|
|
|
|
|
2017-04-13 12:17:38 +02:00
|
|
|
|
2016-08-12 16:11:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-13 12:17:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-12 16:11:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-19 00:30:28 -06:00
|
|
|
|
2013-04-25 15:09:42 -05:00
|
|
|
|
|
|
|
|
|
2013-01-19 00:30:28 -06:00
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
|
|
|
|
|
2013-01-19 00:30:28 -06:00
|
|
|
|
2013-04-21 12:14:45 -05:00
|
|
|
|
2013-01-19 00:30:28 -06:00
|
|
|
|
2013-04-21 12:14:45 -05:00
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
2013-01-19 00:30:28 -06:00
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-19 00:30:28 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-05 01:27:11 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-19 00:30:28 -06:00
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-19 00:30:28 -06:00
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-05 14:46:02 -05:00
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
2013-04-05 14:46:02 -05:00
|
|
|
|
2013-01-19 00:30:28 -06:00
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-21 12:14:45 -05:00
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-19 00:30:28 -06:00
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-19 00:30:28 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-29 13:41:05 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-13 17:20:04 +01:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2015-01-13 17:20:04 +01:00
|
|
|
|
|
|
|
|
|
2014-08-04 18:04:39 +04:00
|
|
|
|
2014-04-08 11:12:11 -07:00
|
|
|
|
2014-08-04 18:04:39 +04:00
|
|
|
|
|
|
|
|
|
2014-03-13 11:21:35 +08:00
|
|
|
|
2014-04-08 11:12:11 -07:00
|
|
|
|
2016-09-20 14:23:17 +02:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
2017-01-31 16:57:31 +01:00
|
|
|
|
|
|
|
|
|
2017-05-22 19:59:24 +02:00
|
|
|
|
2014-04-01 22:22:16 +08:00
|
|
|
|
2017-01-31 16:57:31 +01:00
|
|
|
|
|
|
|
|
|
2014-03-13 11:21:35 +08:00
|
|
|
|
2017-01-31 16:57:31 +01:00
|
|
|
|
|
|
|
|
|
2014-03-13 11:21:35 +08:00
|
|
|
|
2017-01-31 16:57:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-03-13 11:21:35 +08:00
|
|
|
|
2014-08-04 18:04:39 +04:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2014-08-04 18:04:39 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2017-10-12 12:35:19 +02:00
|
|
|
|
|
|
|
|
|
2013-02-20 21:59:33 -06:00
|
|
|
|
2014-08-04 18:04:39 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-20 21:59:33 -06:00
|
|
|
|
2014-08-04 18:04:39 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-20 21:59:33 -06:00
|
|
|
|
2015-01-13 17:20:04 +01:00
|
|
|
|
|
|
|
|
|
2014-04-08 11:12:11 -07:00
|
|
|
|
|
|
|
|
|
2014-03-13 11:21:35 +08:00
|
|
|
|
2014-04-08 11:12:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-08-04 18:04:39 +04:00
|
|
|
|
2014-04-08 11:12:11 -07:00
|
|
|
|
2014-08-04 18:04:39 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2017-04-13 12:17:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
2016-09-29 13:41:05 +02:00
|
|
|
|
2017-04-13 12:17:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
2017-04-13 12:17:39 +02:00
|
|
|
|
2016-09-29 13:41:05 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
2014-03-13 11:21:35 +08:00
|
|
|
|
2014-04-08 11:12:11 -07:00
|
|
|
|
2014-08-04 18:04:39 +04:00
|
|
|
|
|
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
2014-08-04 18:04:39 +04:00
|
|
|
|
|
|
|
|
|
2015-11-27 19:23:24 +01:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2014-04-01 22:22:16 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-08-04 18:04:39 +04:00
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2014-08-04 18:04:39 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
2014-08-04 18:04:39 +04:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2014-08-04 18:04:39 +04:00
|
|
|
|
|
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-08-04 18:04:39 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-03-13 11:21:35 +08:00
|
|
|
|
2014-11-02 15:20:59 +01:00
|
|
|
|
2015-01-13 17:20:04 +01:00
|
|
|
|
2017-06-03 09:38:04 +02:00
|
|
|
|
2014-08-04 18:04:39 +04:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2017-06-03 09:38:05 +02:00
|
|
|
|
2015-01-13 17:20:04 +01:00
|
|
|
|
2014-08-04 18:04:39 +04:00
|
|
|
|
2015-01-13 17:20:04 +01:00
|
|
|
|
|
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
2015-01-13 17:20:04 +01:00
|
|
|
|
2017-06-03 09:38:05 +02:00
|
|
|
|
2012-11-22 00:00:08 -06:00
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2017-04-13 12:17:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-25 23:15:08 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2013-01-17 12:25:27 -06:00
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-17 12:25:27 -06:00
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-17 12:25:27 -06:00
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-17 12:25:27 -06:00
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-03 21:32:51 -05:00
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
2013-01-17 12:25:27 -06:00
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
2013-01-17 12:25:27 -06:00
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-06 13:11:38 -06:00
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-17 12:25:27 -06:00
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
|
|
|
|
|
2013-01-17 12:25:27 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-05-06 09:51:30 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2012-08-02 11:29:46 -05:00
|
|
|
|
2012-04-20 15:49:44 -05:00
|
|
|
|
2012-08-02 11:29:46 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2012-02-07 12:03:36 -06:00
|
|
|
|
2012-08-02 11:29:46 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-07 12:03:36 -06:00
|
|
|
|
2012-08-02 11:29:46 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
2012-08-02 11:29:46 -05:00
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
|
|
|
|
|
2012-08-02 11:29:46 -05:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
2013-04-26 09:43:47 -05:00
|
|
|
|
2012-08-02 11:29:46 -05:00
|
|
|
|
2012-11-01 10:17:15 -05:00
|
|
|
|
|
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
2012-08-02 11:29:46 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-01 10:17:15 -05:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
2011-11-15 14:49:53 -08:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2012-08-02 11:29:46 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-07 12:03:36 -06:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
|
|
|
|
|
2012-08-02 11:29:46 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2013-05-01 12:43:03 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-29 17:26:31 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rbd: fix rbd map vs notify races
A while ago, commit 9875201e1049 ("rbd: fix use-after free of
rbd_dev->disk") fixed rbd unmap vs notify race by introducing
an exported wrapper for flushing notifies and sticking it into
do_rbd_remove().
A similar problem exists on the rbd map path, though: the watch is
registered in rbd_dev_image_probe(), while the disk is set up quite
a few steps later, in rbd_dev_device_setup(). Nothing prevents
a notify from coming in and crashing on a NULL rbd_dev->disk:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000050
Call Trace:
[<ffffffffa0508344>] rbd_watch_cb+0x34/0x180 [rbd]
[<ffffffffa04bd290>] do_event_work+0x40/0xb0 [libceph]
[<ffffffff8109d5db>] process_one_work+0x17b/0x470
[<ffffffff8109e3ab>] worker_thread+0x11b/0x400
[<ffffffff8109e290>] ? rescuer_thread+0x400/0x400
[<ffffffff810a5acf>] kthread+0xcf/0xe0
[<ffffffff810b41b3>] ? finish_task_switch+0x53/0x170
[<ffffffff810a5a00>] ? kthread_create_on_node+0x140/0x140
[<ffffffff81645dd8>] ret_from_fork+0x58/0x90
[<ffffffff810a5a00>] ? kthread_create_on_node+0x140/0x140
RIP [<ffffffffa050828a>] rbd_dev_refresh+0xfa/0x180 [rbd]
If an error occurs during rbd map, we have to error out, potentially
tearing down a watch. Just like on rbd unmap, notifies have to be
flushed, otherwise rbd_watch_cb() may end up trying to read in the
image header after rbd_dev_image_release() has run:
Assertion failure in rbd_dev_header_info() at line 4722:
rbd_assert(rbd_image_format_valid(rbd_dev->image_format));
Call Trace:
[<ffffffff81cccee0>] ? rbd_parent_request_create+0x150/0x150
[<ffffffff81cd4e59>] rbd_dev_refresh+0x59/0x390
[<ffffffff81cd5229>] rbd_watch_cb+0x69/0x290
[<ffffffff81fde9bf>] do_event_work+0x10f/0x1c0
[<ffffffff81107799>] process_one_work+0x689/0x1a80
[<ffffffff811076f7>] ? process_one_work+0x5e7/0x1a80
[<ffffffff81132065>] ? finish_task_switch+0x225/0x640
[<ffffffff81107110>] ? pwq_dec_nr_in_flight+0x2b0/0x2b0
[<ffffffff81108c69>] worker_thread+0xd9/0x1320
[<ffffffff81108b90>] ? process_one_work+0x1a80/0x1a80
[<ffffffff8111b02d>] kthread+0x21d/0x2e0
[<ffffffff8111ae10>] ? kthread_stop+0x550/0x550
[<ffffffff82022802>] ret_from_fork+0x22/0x40
[<ffffffff8111ae10>] ? kthread_stop+0x550/0x550
RIP [<ffffffff81ccd8f9>] rbd_dev_header_info+0xa19/0x1e30
To fix this, a) check if RBD_DEV_FLAG_EXISTS is set before calling
revalidate_disk(), b) move ceph_osdc_flush_notifies() call into
rbd_dev_header_unwatch_sync() to cover rbd map error paths and c) turn
header read-in into a critical section. The latter also happens to
take care of rbd map foo@bar vs rbd snap rm foo@bar race.
Fixes: http://tracker.ceph.com/issues/15490
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2016-04-15 16:22:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-29 17:26:31 -07:00
|
|
|
|
rbd: fix rbd map vs notify races
A while ago, commit 9875201e1049 ("rbd: fix use-after free of
rbd_dev->disk") fixed rbd unmap vs notify race by introducing
an exported wrapper for flushing notifies and sticking it into
do_rbd_remove().
A similar problem exists on the rbd map path, though: the watch is
registered in rbd_dev_image_probe(), while the disk is set up quite
a few steps later, in rbd_dev_device_setup(). Nothing prevents
a notify from coming in and crashing on a NULL rbd_dev->disk:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000050
Call Trace:
[<ffffffffa0508344>] rbd_watch_cb+0x34/0x180 [rbd]
[<ffffffffa04bd290>] do_event_work+0x40/0xb0 [libceph]
[<ffffffff8109d5db>] process_one_work+0x17b/0x470
[<ffffffff8109e3ab>] worker_thread+0x11b/0x400
[<ffffffff8109e290>] ? rescuer_thread+0x400/0x400
[<ffffffff810a5acf>] kthread+0xcf/0xe0
[<ffffffff810b41b3>] ? finish_task_switch+0x53/0x170
[<ffffffff810a5a00>] ? kthread_create_on_node+0x140/0x140
[<ffffffff81645dd8>] ret_from_fork+0x58/0x90
[<ffffffff810a5a00>] ? kthread_create_on_node+0x140/0x140
RIP [<ffffffffa050828a>] rbd_dev_refresh+0xfa/0x180 [rbd]
If an error occurs during rbd map, we have to error out, potentially
tearing down a watch. Just like on rbd unmap, notifies have to be
flushed, otherwise rbd_watch_cb() may end up trying to read in the
image header after rbd_dev_image_release() has run:
Assertion failure in rbd_dev_header_info() at line 4722:
rbd_assert(rbd_image_format_valid(rbd_dev->image_format));
Call Trace:
[<ffffffff81cccee0>] ? rbd_parent_request_create+0x150/0x150
[<ffffffff81cd4e59>] rbd_dev_refresh+0x59/0x390
[<ffffffff81cd5229>] rbd_watch_cb+0x69/0x290
[<ffffffff81fde9bf>] do_event_work+0x10f/0x1c0
[<ffffffff81107799>] process_one_work+0x689/0x1a80
[<ffffffff811076f7>] ? process_one_work+0x5e7/0x1a80
[<ffffffff81132065>] ? finish_task_switch+0x225/0x640
[<ffffffff81107110>] ? pwq_dec_nr_in_flight+0x2b0/0x2b0
[<ffffffff81108c69>] worker_thread+0xd9/0x1320
[<ffffffff81108b90>] ? process_one_work+0x1a80/0x1a80
[<ffffffff8111b02d>] kthread+0x21d/0x2e0
[<ffffffff8111ae10>] ? kthread_stop+0x550/0x550
[<ffffffff82022802>] ret_from_fork+0x22/0x40
[<ffffffff8111ae10>] ? kthread_stop+0x550/0x550
RIP [<ffffffff81ccd8f9>] rbd_dev_header_info+0xa19/0x1e30
To fix this, a) check if RBD_DEV_FLAG_EXISTS is set before calling
revalidate_disk(), b) move ceph_osdc_flush_notifies() call into
rbd_dev_header_unwatch_sync() to cover rbd map error paths and c) turn
header read-in into a critical section. The latter also happens to
take care of rbd map foo@bar vs rbd snap rm foo@bar race.
Fixes: http://tracker.ceph.com/issues/15490
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2016-04-15 16:22:16 +02:00
|
|
|
|
|
|
|
|
|
2013-08-29 17:26:31 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
2012-07-25 09:32:41 -05:00
|
|
|
|
2013-05-06 07:40:30 -05:00
|
|
|
|
2012-07-25 09:32:41 -05:00
|
|
|
|
|
|
|
|
|
2013-05-31 17:40:45 -05:00
|
|
|
|
2013-05-29 11:18:59 -05:00
|
|
|
|
2014-07-23 17:11:19 +04:00
|
|
|
|
|
|
|
|
|
2014-07-23 17:11:20 +04:00
|
|
|
|
2015-01-08 20:18:22 +03:00
|
|
|
|
2013-05-01 12:43:03 -05:00
|
|
|
|
2014-07-24 10:42:13 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-08 20:18:22 +03:00
|
|
|
|
2014-07-24 10:42:13 +04:00
|
|
|
|
|
|
|
|
|
2014-07-23 17:11:21 +04:00
|
|
|
|
2015-01-08 20:18:22 +03:00
|
|
|
|
2014-07-23 17:11:21 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-01 12:43:03 -05:00
|
|
|
|
2015-01-08 20:18:22 +03:00
|
|
|
|
2013-05-31 17:40:45 -05:00
|
|
|
|
2015-01-08 20:18:22 +03:00
|
|
|
|
2013-08-29 17:26:31 -07:00
|
|
|
|
2012-07-25 09:32:41 -05:00
|
|
|
|
2015-01-08 20:18:22 +03:00
|
|
|
|
2012-07-25 09:32:41 -05:00
|
|
|
|
|
|
|
|
|
2017-05-01 10:19:08 -06:00
|
|
|
|
|
|
|
|
|
2015-01-13 17:20:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-30 13:39:16 -07:00
|
|
|
|
2015-01-13 17:20:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-07 12:03:37 -06:00
|
|
|
|
2015-01-13 17:20:04 +01:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2013-12-16 19:26:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2012-08-29 17:11:06 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2012-01-29 13:57:44 -06:00
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-12-13 15:28:57 +02:00
|
|
|
|
2013-12-16 19:26:32 +02:00
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-13 17:20:04 +01:00
|
|
|
|
|
|
|
|
|
2015-06-23 16:21:19 +03:00
|
|
|
|
2015-01-13 17:20:04 +01:00
|
|
|
|
2015-06-23 16:21:19 +03:00
|
|
|
|
2015-01-13 17:20:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2011-07-22 11:35:23 -07:00
|
|
|
|
2015-01-13 17:20:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-24 16:15:17 +03:00
|
|
|
|
|
|
|
|
|
2012-02-07 12:03:37 -06:00
|
|
|
|
2011-07-22 11:35:23 -07:00
|
|
|
|
2012-02-07 12:03:37 -06:00
|
|
|
|
|
|
|
|
|
2015-10-07 16:09:35 +02:00
|
|
|
|
2017-12-21 15:35:11 +01:00
|
|
|
|
2012-02-07 12:03:37 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-07-22 11:35:23 -07:00
|
|
|
|
2014-04-01 22:22:16 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-14 08:15:12 -06:00
|
|
|
|
2017-05-22 19:59:24 +02:00
|
|
|
|
2014-04-01 22:22:16 +08:00
|
|
|
|
2015-10-15 18:50:46 +00:00
|
|
|
|
2017-02-02 15:56:50 +01:00
|
|
|
|
2015-10-15 18:50:46 +00:00
|
|
|
|
2017-04-13 12:17:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-13 17:20:04 +01:00
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2015-01-13 17:20:04 +01:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-07 12:03:37 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-07 12:03:37 -06:00
|
|
|
|
2011-12-05 10:35:04 -08:00
|
|
|
|
2013-04-26 15:44:36 -05:00
|
|
|
|
|
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
|
|
|
|
|
2012-07-13 20:35:12 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-26 15:44:36 -05:00
|
|
|
|
2012-07-13 20:35:12 -05:00
|
|
|
|
|
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-07 12:03:37 -06:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-04-26 15:44:36 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-13 15:28:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-26 15:44:36 -05:00
|
|
|
|
2013-12-13 15:28:57 +02:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
|
|
|
|
|
2016-08-18 18:38:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2012-02-07 12:03:37 -06:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
2012-01-24 10:08:37 -06:00
|
|
|
|
2016-08-12 14:59:58 +02:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2016-08-18 18:38:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-18 18:38:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2012-02-07 12:03:37 -06:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
|
|
|
|
|
2012-07-12 10:46:35 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2013-04-26 15:44:36 -05:00
|
|
|
|
2012-07-12 10:46:35 -05:00
|
|
|
|
|
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-07 12:03:37 -06:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
|
|
|
|
|
2012-07-10 20:30:11 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-07-10 20:30:11 -05:00
|
|
|
|
|
|
|
|
|
2012-07-13 20:35:12 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-07 12:03:37 -06:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
|
|
|
|
|
2016-08-18 18:38:44 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2014-07-22 21:53:07 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
|
|
|
|
|
2014-07-22 21:53:07 +04:00
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
|
|
|
|
|
2014-07-22 21:53:07 +04:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2014-07-22 21:53:07 +04:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
|
|
|
|
|
2014-07-22 21:53:07 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
|
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-07 12:03:37 -06:00
|
|
|
|
2012-07-25 09:32:41 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
2013-05-06 07:40:30 -05:00
|
|
|
|
2014-07-23 17:11:20 +04:00
|
|
|
|
2012-07-25 09:32:41 -05:00
|
|
|
|
2014-07-23 17:11:20 +04:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
2012-07-13 20:35:12 -05:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
2013-12-13 15:28:57 +02:00
|
|
|
|
2016-08-18 18:38:43 +02:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
2016-08-18 18:38:43 +02:00
|
|
|
|
2016-08-18 18:38:45 +02:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
2012-07-12 10:46:35 -05:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
2012-07-10 20:30:11 -05:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
|
|
|
|
|
2016-08-18 18:38:44 +02:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-13 20:35:12 -05:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
2013-12-13 15:28:57 +02:00
|
|
|
|
2016-08-18 18:38:43 +02:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
2016-08-18 18:38:43 +02:00
|
|
|
|
2016-08-18 18:38:45 +02:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
2012-07-12 10:46:35 -05:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
2012-07-10 20:30:11 -05:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
2016-08-18 18:38:44 +02:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-16 20:11:25 +02:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
2017-02-11 12:14:38 +05:30
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
|
|
|
|
|
2015-10-16 20:11:25 +02:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
|
|
|
|
|
2012-10-26 17:25:24 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-23 17:11:20 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-26 17:25:24 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-12 15:45:52 +02:00
|
|
|
|
2015-10-16 17:09:24 +02:00
|
|
|
|
2016-08-12 16:11:41 +02:00
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
2015-10-16 17:09:24 +02:00
|
|
|
|
2016-04-29 20:01:25 +02:00
|
|
|
|
2016-08-05 16:15:38 +02:00
|
|
|
|
2016-08-18 18:38:45 +02:00
|
|
|
|
2016-04-29 20:01:25 +02:00
|
|
|
|
2015-10-16 17:09:24 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-12 15:45:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-16 17:09:24 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-12 15:45:52 +02:00
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-12 15:45:52 +02:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:22 +01:00
|
|
|
|
2016-04-29 20:01:25 +02:00
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
2016-04-29 20:01:25 +02:00
|
|
|
|
2016-08-12 16:11:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-12 16:40:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-16 17:09:24 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2015-06-22 13:24:48 +03:00
|
|
|
|
2012-11-14 12:25:19 -06:00
|
|
|
|
2016-08-12 15:45:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-16 17:09:24 +02:00
|
|
|
|
2016-08-12 15:45:52 +02:00
|
|
|
|
|
|
|
|
|
2015-10-16 17:09:24 +02:00
|
|
|
|
2016-08-12 15:45:52 +02:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2016-08-12 15:45:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-16 17:09:24 +02:00
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
|
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-19 00:30:28 -06:00
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
|
|
|
|
|
2013-04-21 12:14:45 -05:00
|
|
|
|
|
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
2013-08-28 17:08:10 -07:00
|
|
|
|
2013-04-25 15:09:41 -05:00
|
|
|
|
2013-08-28 17:08:10 -07:00
|
|
|
|
|
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
|
|
|
|
|
2013-08-28 17:08:10 -07:00
|
|
|
|
|
|
|
|
|
2013-04-21 12:14:45 -05:00
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-19 00:30:28 -06:00
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-21 12:14:45 -05:00
|
|
|
|
|
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-21 12:14:45 -05:00
|
|
|
|
2016-04-13 14:15:50 +02:00
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-19 00:30:28 -06:00
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
|
|
|
|
|
2013-04-21 12:14:45 -05:00
|
|
|
|
|
|
|
|
|
2012-10-09 13:50:17 -07:00
|
|
|
|
2016-04-13 14:15:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-01 08:39:26 -05:00
|
|
|
|
2016-04-13 14:15:50 +02:00
|
|
|
|
2012-10-09 13:50:17 -07:00
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-21 12:14:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2013-05-29 11:18:59 -05:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-24 10:42:13 +04:00
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-19 00:30:28 -06:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-21 12:14:45 -05:00
|
|
|
|
|
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
rbd: detect when clone image is flattened
A format 2 clone image can be the subject of a "flatten" operation,
during which all of its data gets "copied up" from its parent image,
leaving the image fully populated. Once this is complete, the
clone's association with the parent is abolished.
Since this can occur when a clone is mapped, we need to detect when
it has occurred and handle it accordingly. We know an image has
been flattened when we know it at one time had a parent, but we have
learned (via a "get_parent" object class method call) it no longer
has one.
There might be in-flight requests at the point we learn an image has
been flattened, so we can't simply clean up parent data structures
right away. Instead, we'll drop the initial parent reference when
the parent has disappeared (rather than when the image gets
destroyed), which will allow the last in-flight reference to clean
things up when it's complete.
We leverage the fact that a zero parent overlap renders an image
effectively unlayered. We set the overlap to 0 at the point we
detect the clone image has flattened, which allows the unlayered
behavior to take effect immediately, while keeping other parent
structures in place until in-flight requests to complete.
This and the next few patches resolve:
http://tracker.ceph.com/issues/3763
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-05-06 17:40:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
rbd: detect when clone image is flattened
A format 2 clone image can be the subject of a "flatten" operation,
during which all of its data gets "copied up" from its parent image,
leaving the image fully populated. Once this is complete, the
clone's association with the parent is abolished.
Since this can occur when a clone is mapped, we need to detect when
it has occurred and handle it accordingly. We know an image has
been flattened when we know it at one time had a parent, but we have
learned (via a "get_parent" object class method call) it no longer
has one.
There might be in-flight requests at the point we learn an image has
been flattened, so we can't simply clean up parent data structures
right away. Instead, we'll drop the initial parent reference when
the parent has disappeared (rather than when the image gets
destroyed), which will allow the last in-flight reference to clean
things up when it's complete.
We leverage the fact that a zero parent overlap renders an image
effectively unlayered. We set the overlap to 0 at the point we
detect the clone image has flattened, which allows the unlayered
behavior to take effect immediately, while keeping other parent
structures in place until in-flight requests to complete.
This and the next few patches resolve:
http://tracker.ceph.com/issues/3763
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-05-06 17:40:33 -05:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2012-11-14 12:25:19 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
2014-07-11 12:11:20 +04:00
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
2013-04-21 12:14:45 -05:00
|
|
|
|
2013-04-26 09:43:47 -05:00
|
|
|
|
2012-11-14 12:25:19 -06:00
|
|
|
|
2012-11-01 08:39:26 -05:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-29 11:18:59 -05:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
|
|
|
|
|
2013-05-29 11:18:59 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
|
|
|
|
|
2014-06-27 21:46:33 +04:00
|
|
|
|
|
|
|
|
|
2013-05-29 11:18:59 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-19 22:57:39 +03:00
|
|
|
|
|
|
|
|
|
2013-05-29 11:18:59 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-19 22:57:39 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-29 11:18:59 -05:00
|
|
|
|
2015-01-19 22:57:39 +03:00
|
|
|
|
|
|
|
|
|
2013-05-29 11:18:59 -05:00
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
2015-01-19 22:57:39 +03:00
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-21 12:14:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-21 12:14:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:22 +01:00
|
|
|
|
2013-04-21 12:14:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-26 09:43:47 -05:00
|
|
|
|
|
|
|
|
|
2013-04-21 12:14:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-01 08:39:26 -05:00
|
|
|
|
|
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-21 12:14:45 -05:00
|
|
|
|
2013-04-21 12:14:45 -05:00
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-25 15:09:42 -05:00
|
|
|
|
|
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-29 19:16:42 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
2014-07-23 17:11:20 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-25 23:15:08 -05:00
|
|
|
|
2014-07-23 17:11:20 +04:00
|
|
|
|
|
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
2014-07-23 17:11:20 +04:00
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
2013-04-26 09:43:48 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
|
|
|
|
|
2014-07-23 17:11:20 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
2013-04-26 09:43:48 -05:00
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
2013-04-26 09:43:48 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-01 10:17:15 -05:00
|
|
|
|
|
|
|
|
|
2013-04-26 09:43:48 -05:00
|
|
|
|
|
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-26 09:43:48 -05:00
|
|
|
|
|
|
|
|
|
2012-11-01 10:17:15 -05:00
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
2014-07-23 17:11:20 +04:00
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
2013-04-26 09:43:48 -05:00
|
|
|
|
2013-09-04 17:57:31 -07:00
|
|
|
|
|
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
2013-04-26 09:43:48 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
|
|
|
|
|
2014-07-23 17:11:20 +04:00
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
2013-04-26 09:43:48 -05:00
|
|
|
|
|
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-19 00:30:28 -06:00
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-21 12:14:45 -05:00
|
|
|
|
|
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-26 09:43:47 -05:00
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
2013-04-30 00:44:32 -05:00
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-06 08:37:00 -05:00
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-21 12:14:45 -05:00
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-21 12:14:45 -05:00
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
|
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
|
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-19 00:30:28 -06:00
|
|
|
|
2013-04-25 15:09:42 -05:00
|
|
|
|
|
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
2013-04-25 15:09:42 -05:00
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
|
|
|
|
|
2013-04-25 15:09:42 -05:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2013-04-25 15:09:42 -05:00
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
|
|
|
|
|
2013-04-25 15:09:42 -05:00
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-25 15:09:42 -05:00
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
|
|
|
|
|
2013-05-06 09:51:30 -05:00
|
|
|
|
2012-08-31 17:29:55 -05:00
|
|
|
|
2013-05-06 09:51:30 -05:00
|
|
|
|
2012-08-31 17:29:55 -05:00
|
|
|
|
|
|
|
|
|
2013-06-12 14:43:10 -07:00
|
|
|
|
|
|
|
|
|
2013-05-31 17:40:45 -05:00
|
|
|
|
2013-06-12 14:43:10 -07:00
|
|
|
|
2013-05-06 09:51:30 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-31 17:40:45 -05:00
|
|
|
|
2013-05-06 09:51:30 -05:00
|
|
|
|
|
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
2015-08-31 18:22:10 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-31 17:29:55 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-23 17:11:19 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-02 08:13:30 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-07 12:03:37 -06:00
|
|
|
|
|
|
|
|
|
2012-02-02 08:13:30 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-09 21:04:23 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-01 08:39:27 -05:00
|
|
|
|
2012-07-09 21:04:23 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-02 08:13:30 -06:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-12 10:46:35 -05:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-02 08:13:30 -06:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
|
|
|
|
|
2012-02-02 08:13:30 -06:00
|
|
|
|
2012-07-12 10:46:35 -05:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2013-04-26 09:43:47 -05:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-02-02 08:13:30 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-02 08:13:30 -06:00
|
|
|
|
2012-11-01 10:17:15 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-02-02 08:13:30 -06:00
|
|
|
|
2012-02-02 08:13:30 -06:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-11-01 10:17:15 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-02 08:13:30 -06:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-01 10:17:15 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-02 08:13:30 -06:00
|
|
|
|
2012-11-01 08:39:26 -05:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-11-01 10:17:15 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-31 17:29:52 -05:00
|
|
|
|
2012-07-09 21:04:24 -05:00
|
|
|
|
2012-08-31 17:29:52 -05:00
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-07-09 21:04:24 -05:00
|
|
|
|
2013-04-26 09:43:47 -05:00
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2013-04-26 09:43:47 -05:00
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-02-02 08:13:30 -06:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-23 16:21:19 +03:00
|
|
|
|
2016-09-20 14:23:17 +02:00
|
|
|
|
2017-04-13 12:17:39 +02:00
|
|
|
|
2012-07-12 10:46:35 -05:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-07-12 10:46:35 -05:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-07-12 10:46:35 -05:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-02-02 08:13:30 -06:00
|
|
|
|
|
|
|
|
|
2014-05-13 11:19:27 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-15 12:02:17 +03:00
|
|
|
|
2014-05-13 11:19:27 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-04-28 16:07:27 +02:00
|
|
|
|
|
|
|
|
|
2014-05-13 11:19:27 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-04-28 16:07:28 +02:00
|
|
|
|
2014-05-13 11:19:27 +04:00
|
|
|
|
2015-05-15 12:02:17 +03:00
|
|
|
|
|
|
|
|
|
2014-05-13 11:19:27 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-13 12:17:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-10 20:30:11 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
2012-07-10 20:30:11 -05:00
|
|
|
|
2013-04-25 23:15:08 -05:00
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-25 23:15:08 -05:00
|
|
|
|
|
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
2013-04-25 23:15:08 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
2013-04-25 23:15:08 -05:00
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
2012-07-10 20:30:11 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-10 20:30:11 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-25 23:15:08 -05:00
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-19 00:30:28 -06:00
|
|
|
|
2013-04-25 23:15:08 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-11 18:49:18 +04:00
|
|
|
|
2013-04-25 23:15:08 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-01 08:39:26 -05:00
|
|
|
|
2014-04-11 16:38:12 +08:00
|
|
|
|
2013-04-25 23:15:08 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-10 20:30:11 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:21 +01:00
|
|
|
|
2012-07-10 20:30:11 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-13 20:35:37 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-28 23:32:34 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-19 12:06:14 +03:00
|
|
|
|
2013-04-28 23:32:34 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-30 00:44:32 -05:00
|
|
|
|
2013-04-28 23:32:34 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-06 09:51:30 -05:00
|
|
|
|
2012-07-10 20:30:11 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
2013-04-21 12:14:45 -05:00
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
|
|
|
|
|
2013-05-06 09:51:30 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
2013-04-21 12:14:45 -05:00
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
2013-04-21 12:14:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-10 20:30:11 -05:00
|
|
|
|
2017-01-25 18:16:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:22 +01:00
|
|
|
|
2012-08-31 17:29:55 -05:00
|
|
|
|
2017-01-25 18:16:22 +01:00
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
|
|
|
|
|
2012-07-03 16:01:19 -05:00
|
|
|
|
2012-07-10 20:30:11 -05:00
|
|
|
|
|
|
|
|
|
2015-10-11 19:38:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-30 15:47:17 -05:00
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
2013-04-26 15:44:36 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-11 19:38:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-12 15:45:52 +02:00
|
|
|
|
2015-10-11 19:38:00 +02:00
|
|
|
|
|
|
|
|
|
2013-04-26 15:44:36 -05:00
|
|
|
|
2015-10-11 19:38:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-26 15:44:36 -05:00
|
|
|
|
2015-10-11 19:38:00 +02:00
|
|
|
|
2013-04-26 15:44:36 -05:00
|
|
|
|
|
|
|
|
|
2015-10-11 19:38:00 +02:00
|
|
|
|
2013-04-26 15:44:36 -05:00
|
|
|
|
2013-05-08 22:50:04 -05:00
|
|
|
|
2013-04-26 15:44:36 -05:00
|
|
|
|
2015-10-11 19:38:00 +02:00
|
|
|
|
2013-04-26 15:44:36 -05:00
|
|
|
|
2015-10-11 19:38:00 +02:00
|
|
|
|
2015-11-23 20:16:45 +01:00
|
|
|
|
2013-04-26 15:44:36 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-13 12:17:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rbd: fix rbd map vs notify races
A while ago, commit 9875201e1049 ("rbd: fix use-after free of
rbd_dev->disk") fixed rbd unmap vs notify race by introducing
an exported wrapper for flushing notifies and sticking it into
do_rbd_remove().
A similar problem exists on the rbd map path, though: the watch is
registered in rbd_dev_image_probe(), while the disk is set up quite
a few steps later, in rbd_dev_device_setup(). Nothing prevents
a notify from coming in and crashing on a NULL rbd_dev->disk:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000050
Call Trace:
[<ffffffffa0508344>] rbd_watch_cb+0x34/0x180 [rbd]
[<ffffffffa04bd290>] do_event_work+0x40/0xb0 [libceph]
[<ffffffff8109d5db>] process_one_work+0x17b/0x470
[<ffffffff8109e3ab>] worker_thread+0x11b/0x400
[<ffffffff8109e290>] ? rescuer_thread+0x400/0x400
[<ffffffff810a5acf>] kthread+0xcf/0xe0
[<ffffffff810b41b3>] ? finish_task_switch+0x53/0x170
[<ffffffff810a5a00>] ? kthread_create_on_node+0x140/0x140
[<ffffffff81645dd8>] ret_from_fork+0x58/0x90
[<ffffffff810a5a00>] ? kthread_create_on_node+0x140/0x140
RIP [<ffffffffa050828a>] rbd_dev_refresh+0xfa/0x180 [rbd]
If an error occurs during rbd map, we have to error out, potentially
tearing down a watch. Just like on rbd unmap, notifies have to be
flushed, otherwise rbd_watch_cb() may end up trying to read in the
image header after rbd_dev_image_release() has run:
Assertion failure in rbd_dev_header_info() at line 4722:
rbd_assert(rbd_image_format_valid(rbd_dev->image_format));
Call Trace:
[<ffffffff81cccee0>] ? rbd_parent_request_create+0x150/0x150
[<ffffffff81cd4e59>] rbd_dev_refresh+0x59/0x390
[<ffffffff81cd5229>] rbd_watch_cb+0x69/0x290
[<ffffffff81fde9bf>] do_event_work+0x10f/0x1c0
[<ffffffff81107799>] process_one_work+0x689/0x1a80
[<ffffffff811076f7>] ? process_one_work+0x5e7/0x1a80
[<ffffffff81132065>] ? finish_task_switch+0x225/0x640
[<ffffffff81107110>] ? pwq_dec_nr_in_flight+0x2b0/0x2b0
[<ffffffff81108c69>] worker_thread+0xd9/0x1320
[<ffffffff81108b90>] ? process_one_work+0x1a80/0x1a80
[<ffffffff8111b02d>] kthread+0x21d/0x2e0
[<ffffffff8111ae10>] ? kthread_stop+0x550/0x550
[<ffffffff82022802>] ret_from_fork+0x22/0x40
[<ffffffff8111ae10>] ? kthread_stop+0x550/0x550
RIP [<ffffffff81ccd8f9>] rbd_dev_header_info+0xa19/0x1e30
To fix this, a) check if RBD_DEV_FLAG_EXISTS is set before calling
revalidate_disk(), b) move ceph_osdc_flush_notifies() call into
rbd_dev_header_unwatch_sync() to cover rbd map error paths and c) turn
header read-in into a critical section. The latter also happens to
take care of rbd map foo@bar vs rbd snap rm foo@bar race.
Fixes: http://tracker.ceph.com/issues/15490
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2016-04-15 16:22:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-28 23:32:34 -05:00
|
|
|
|
2013-04-26 15:44:36 -05:00
|
|
|
|
2012-10-30 15:47:17 -05:00
|
|
|
|
2013-04-27 09:59:30 -05:00
|
|
|
|
rbd: add support for single-major device number allocation scheme
Currently each rbd device is allocated its own major number, which
leads to a hard limit of 230-250 images mapped at once. This commit
adds support for a new single-major device number allocation scheme,
which is hidden behind a new single_major boolean module parameter and
is disabled by default for backwards compatibility reasons. (Old
userspace cannot correctly unmap images mapped under single-major
scheme and would essentially just unmap a random image, if that.)
$ rbd showmapped
id pool image snap device
0 rbd b100 - /dev/rbd0
1 rbd b101 - /dev/rbd1
2 rbd b102 - /dev/rbd2
3 rbd b103 - /dev/rbd3
Old scheme (modprobe rbd):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:24 /dev/rbd0
brw-rw---- 1 root disk 252, 0 Dec 10 12:28 /dev/rbd1
brw-rw---- 1 root disk 252, 1 Dec 10 12:28 /dev/rbd1p1
brw-rw---- 1 root disk 252, 2 Dec 10 12:28 /dev/rbd1p2
brw-rw---- 1 root disk 252, 3 Dec 10 12:28 /dev/rbd1p3
brw-rw---- 1 root disk 251, 0 Dec 10 12:28 /dev/rbd2
brw-rw---- 1 root disk 251, 1 Dec 10 12:28 /dev/rbd2p1
brw-rw---- 1 root disk 250, 0 Dec 10 12:24 /dev/rbd3
New scheme (modprobe rbd single_major=Y):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:30 /dev/rbd0
brw-rw---- 1 root disk 253, 256 Dec 10 12:30 /dev/rbd1
brw-rw---- 1 root disk 253, 257 Dec 10 12:30 /dev/rbd1p1
brw-rw---- 1 root disk 253, 258 Dec 10 12:30 /dev/rbd1p2
brw-rw---- 1 root disk 253, 259 Dec 10 12:30 /dev/rbd1p3
brw-rw---- 1 root disk 253, 512 Dec 10 12:30 /dev/rbd2
brw-rw---- 1 root disk 253, 513 Dec 10 12:30 /dev/rbd2p1
brw-rw---- 1 root disk 253, 768 Dec 10 12:30 /dev/rbd3
(major 253 was assigned dynamically at module load time)
The new limit is 4096 images mapped at once, and it comes from the fact
that, as before, 256 minor numbers are reserved for each mapping.
(A follow-up commit changes the number of minors reserved and the way
we deal with partitions over that number.)
If single_major is set to true, two new sysfs interfaces show up:
/sys/bus/rbd/{add,remove}_single_major. These are to be used instead
of /sys/bus/rbd/{add,remove}, which are disabled for backwards
compatibility reasons outlined above.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-13 15:28:57 +02:00
|
|
|
|
2012-10-30 15:47:17 -05:00
|
|
|
|
rbd: add support for single-major device number allocation scheme
Currently each rbd device is allocated its own major number, which
leads to a hard limit of 230-250 images mapped at once. This commit
adds support for a new single-major device number allocation scheme,
which is hidden behind a new single_major boolean module parameter and
is disabled by default for backwards compatibility reasons. (Old
userspace cannot correctly unmap images mapped under single-major
scheme and would essentially just unmap a random image, if that.)
$ rbd showmapped
id pool image snap device
0 rbd b100 - /dev/rbd0
1 rbd b101 - /dev/rbd1
2 rbd b102 - /dev/rbd2
3 rbd b103 - /dev/rbd3
Old scheme (modprobe rbd):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:24 /dev/rbd0
brw-rw---- 1 root disk 252, 0 Dec 10 12:28 /dev/rbd1
brw-rw---- 1 root disk 252, 1 Dec 10 12:28 /dev/rbd1p1
brw-rw---- 1 root disk 252, 2 Dec 10 12:28 /dev/rbd1p2
brw-rw---- 1 root disk 252, 3 Dec 10 12:28 /dev/rbd1p3
brw-rw---- 1 root disk 251, 0 Dec 10 12:28 /dev/rbd2
brw-rw---- 1 root disk 251, 1 Dec 10 12:28 /dev/rbd2p1
brw-rw---- 1 root disk 250, 0 Dec 10 12:24 /dev/rbd3
New scheme (modprobe rbd single_major=Y):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:30 /dev/rbd0
brw-rw---- 1 root disk 253, 256 Dec 10 12:30 /dev/rbd1
brw-rw---- 1 root disk 253, 257 Dec 10 12:30 /dev/rbd1p1
brw-rw---- 1 root disk 253, 258 Dec 10 12:30 /dev/rbd1p2
brw-rw---- 1 root disk 253, 259 Dec 10 12:30 /dev/rbd1p3
brw-rw---- 1 root disk 253, 512 Dec 10 12:30 /dev/rbd2
brw-rw---- 1 root disk 253, 513 Dec 10 12:30 /dev/rbd2p1
brw-rw---- 1 root disk 253, 768 Dec 10 12:30 /dev/rbd3
(major 253 was assigned dynamically at module load time)
The new limit is 4096 images mapped at once, and it comes from the fact
that, as before, 256 minor numbers are reserved for each mapping.
(A follow-up commit changes the number of minors reserved and the way
we deal with partitions over that number.)
If single_major is set to true, two new sysfs interfaces show up:
/sys/bus/rbd/{add,remove}_single_major. These are to be used instead
of /sys/bus/rbd/{add,remove}, which are disabled for backwards
compatibility reasons outlined above.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-13 15:28:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-12 15:45:52 +02:00
|
|
|
|
rbd: add support for single-major device number allocation scheme
Currently each rbd device is allocated its own major number, which
leads to a hard limit of 230-250 images mapped at once. This commit
adds support for a new single-major device number allocation scheme,
which is hidden behind a new single_major boolean module parameter and
is disabled by default for backwards compatibility reasons. (Old
userspace cannot correctly unmap images mapped under single-major
scheme and would essentially just unmap a random image, if that.)
$ rbd showmapped
id pool image snap device
0 rbd b100 - /dev/rbd0
1 rbd b101 - /dev/rbd1
2 rbd b102 - /dev/rbd2
3 rbd b103 - /dev/rbd3
Old scheme (modprobe rbd):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:24 /dev/rbd0
brw-rw---- 1 root disk 252, 0 Dec 10 12:28 /dev/rbd1
brw-rw---- 1 root disk 252, 1 Dec 10 12:28 /dev/rbd1p1
brw-rw---- 1 root disk 252, 2 Dec 10 12:28 /dev/rbd1p2
brw-rw---- 1 root disk 252, 3 Dec 10 12:28 /dev/rbd1p3
brw-rw---- 1 root disk 251, 0 Dec 10 12:28 /dev/rbd2
brw-rw---- 1 root disk 251, 1 Dec 10 12:28 /dev/rbd2p1
brw-rw---- 1 root disk 250, 0 Dec 10 12:24 /dev/rbd3
New scheme (modprobe rbd single_major=Y):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:30 /dev/rbd0
brw-rw---- 1 root disk 253, 256 Dec 10 12:30 /dev/rbd1
brw-rw---- 1 root disk 253, 257 Dec 10 12:30 /dev/rbd1p1
brw-rw---- 1 root disk 253, 258 Dec 10 12:30 /dev/rbd1p2
brw-rw---- 1 root disk 253, 259 Dec 10 12:30 /dev/rbd1p3
brw-rw---- 1 root disk 253, 512 Dec 10 12:30 /dev/rbd2
brw-rw---- 1 root disk 253, 513 Dec 10 12:30 /dev/rbd2p1
brw-rw---- 1 root disk 253, 768 Dec 10 12:30 /dev/rbd3
(major 253 was assigned dynamically at module load time)
The new limit is 4096 images mapped at once, and it comes from the fact
that, as before, 256 minor numbers are reserved for each mapping.
(A follow-up commit changes the number of minors reserved and the way
we deal with partitions over that number.)
If single_major is set to true, two new sysfs interfaces show up:
/sys/bus/rbd/{add,remove}_single_major. These are to be used instead
of /sys/bus/rbd/{add,remove}, which are disabled for backwards
compatibility reasons outlined above.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-13 15:28:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-30 15:47:17 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
2012-10-30 15:47:17 -05:00
|
|
|
|
|
|
|
|
|
2014-08-04 18:04:39 +04:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
2017-10-12 12:35:19 +02:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
2017-04-13 12:17:38 +02:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
2014-10-09 17:06:01 +04:00
|
|
|
|
2012-10-30 15:47:17 -05:00
|
|
|
|
2013-04-26 15:44:36 -05:00
|
|
|
|
rbd: fix rbd map vs notify races
A while ago, commit 9875201e1049 ("rbd: fix use-after free of
rbd_dev->disk") fixed rbd unmap vs notify race by introducing
an exported wrapper for flushing notifies and sticking it into
do_rbd_remove().
A similar problem exists on the rbd map path, though: the watch is
registered in rbd_dev_image_probe(), while the disk is set up quite
a few steps later, in rbd_dev_device_setup(). Nothing prevents
a notify from coming in and crashing on a NULL rbd_dev->disk:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000050
Call Trace:
[<ffffffffa0508344>] rbd_watch_cb+0x34/0x180 [rbd]
[<ffffffffa04bd290>] do_event_work+0x40/0xb0 [libceph]
[<ffffffff8109d5db>] process_one_work+0x17b/0x470
[<ffffffff8109e3ab>] worker_thread+0x11b/0x400
[<ffffffff8109e290>] ? rescuer_thread+0x400/0x400
[<ffffffff810a5acf>] kthread+0xcf/0xe0
[<ffffffff810b41b3>] ? finish_task_switch+0x53/0x170
[<ffffffff810a5a00>] ? kthread_create_on_node+0x140/0x140
[<ffffffff81645dd8>] ret_from_fork+0x58/0x90
[<ffffffff810a5a00>] ? kthread_create_on_node+0x140/0x140
RIP [<ffffffffa050828a>] rbd_dev_refresh+0xfa/0x180 [rbd]
If an error occurs during rbd map, we have to error out, potentially
tearing down a watch. Just like on rbd unmap, notifies have to be
flushed, otherwise rbd_watch_cb() may end up trying to read in the
image header after rbd_dev_image_release() has run:
Assertion failure in rbd_dev_header_info() at line 4722:
rbd_assert(rbd_image_format_valid(rbd_dev->image_format));
Call Trace:
[<ffffffff81cccee0>] ? rbd_parent_request_create+0x150/0x150
[<ffffffff81cd4e59>] rbd_dev_refresh+0x59/0x390
[<ffffffff81cd5229>] rbd_watch_cb+0x69/0x290
[<ffffffff81fde9bf>] do_event_work+0x10f/0x1c0
[<ffffffff81107799>] process_one_work+0x689/0x1a80
[<ffffffff811076f7>] ? process_one_work+0x5e7/0x1a80
[<ffffffff81132065>] ? finish_task_switch+0x225/0x640
[<ffffffff81107110>] ? pwq_dec_nr_in_flight+0x2b0/0x2b0
[<ffffffff81108c69>] worker_thread+0xd9/0x1320
[<ffffffff81108b90>] ? process_one_work+0x1a80/0x1a80
[<ffffffff8111b02d>] kthread+0x21d/0x2e0
[<ffffffff8111ae10>] ? kthread_stop+0x550/0x550
[<ffffffff82022802>] ret_from_fork+0x22/0x40
[<ffffffff8111ae10>] ? kthread_stop+0x550/0x550
RIP [<ffffffff81ccd8f9>] rbd_dev_header_info+0xa19/0x1e30
To fix this, a) check if RBD_DEV_FLAG_EXISTS is set before calling
revalidate_disk(), b) move ceph_osdc_flush_notifies() call into
rbd_dev_header_unwatch_sync() to cover rbd map error paths and c) turn
header read-in into a critical section. The latter also happens to
take care of rbd map foo@bar vs rbd snap rm foo@bar race.
Fixes: http://tracker.ceph.com/issues/15490
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2016-04-15 16:22:16 +02:00
|
|
|
|
2017-04-13 12:17:38 +02:00
|
|
|
|
2012-10-30 19:40:33 -05:00
|
|
|
|
2013-05-06 09:51:29 -05:00
|
|
|
|
|
|
|
|
|
2012-10-30 15:47:17 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rbd: add support for single-major device number allocation scheme
Currently each rbd device is allocated its own major number, which
leads to a hard limit of 230-250 images mapped at once. This commit
adds support for a new single-major device number allocation scheme,
which is hidden behind a new single_major boolean module parameter and
is disabled by default for backwards compatibility reasons. (Old
userspace cannot correctly unmap images mapped under single-major
scheme and would essentially just unmap a random image, if that.)
$ rbd showmapped
id pool image snap device
0 rbd b100 - /dev/rbd0
1 rbd b101 - /dev/rbd1
2 rbd b102 - /dev/rbd2
3 rbd b103 - /dev/rbd3
Old scheme (modprobe rbd):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:24 /dev/rbd0
brw-rw---- 1 root disk 252, 0 Dec 10 12:28 /dev/rbd1
brw-rw---- 1 root disk 252, 1 Dec 10 12:28 /dev/rbd1p1
brw-rw---- 1 root disk 252, 2 Dec 10 12:28 /dev/rbd1p2
brw-rw---- 1 root disk 252, 3 Dec 10 12:28 /dev/rbd1p3
brw-rw---- 1 root disk 251, 0 Dec 10 12:28 /dev/rbd2
brw-rw---- 1 root disk 251, 1 Dec 10 12:28 /dev/rbd2p1
brw-rw---- 1 root disk 250, 0 Dec 10 12:24 /dev/rbd3
New scheme (modprobe rbd single_major=Y):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:30 /dev/rbd0
brw-rw---- 1 root disk 253, 256 Dec 10 12:30 /dev/rbd1
brw-rw---- 1 root disk 253, 257 Dec 10 12:30 /dev/rbd1p1
brw-rw---- 1 root disk 253, 258 Dec 10 12:30 /dev/rbd1p2
brw-rw---- 1 root disk 253, 259 Dec 10 12:30 /dev/rbd1p3
brw-rw---- 1 root disk 253, 512 Dec 10 12:30 /dev/rbd2
brw-rw---- 1 root disk 253, 513 Dec 10 12:30 /dev/rbd2p1
brw-rw---- 1 root disk 253, 768 Dec 10 12:30 /dev/rbd3
(major 253 was assigned dynamically at module load time)
The new limit is 4096 images mapped at once, and it comes from the fact
that, as before, 256 minor numbers are reserved for each mapping.
(A follow-up commit changes the number of minors reserved and the way
we deal with partitions over that number.)
If single_major is set to true, two new sysfs interfaces show up:
/sys/bus/rbd/{add,remove}_single_major. These are to be used instead
of /sys/bus/rbd/{add,remove}, which are disabled for backwards
compatibility reasons outlined above.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-13 15:28:57 +02:00
|
|
|
|
|
|
|
|
|
rbd: fix rbd map vs notify races
A while ago, commit 9875201e1049 ("rbd: fix use-after free of
rbd_dev->disk") fixed rbd unmap vs notify race by introducing
an exported wrapper for flushing notifies and sticking it into
do_rbd_remove().
A similar problem exists on the rbd map path, though: the watch is
registered in rbd_dev_image_probe(), while the disk is set up quite
a few steps later, in rbd_dev_device_setup(). Nothing prevents
a notify from coming in and crashing on a NULL rbd_dev->disk:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000050
Call Trace:
[<ffffffffa0508344>] rbd_watch_cb+0x34/0x180 [rbd]
[<ffffffffa04bd290>] do_event_work+0x40/0xb0 [libceph]
[<ffffffff8109d5db>] process_one_work+0x17b/0x470
[<ffffffff8109e3ab>] worker_thread+0x11b/0x400
[<ffffffff8109e290>] ? rescuer_thread+0x400/0x400
[<ffffffff810a5acf>] kthread+0xcf/0xe0
[<ffffffff810b41b3>] ? finish_task_switch+0x53/0x170
[<ffffffff810a5a00>] ? kthread_create_on_node+0x140/0x140
[<ffffffff81645dd8>] ret_from_fork+0x58/0x90
[<ffffffff810a5a00>] ? kthread_create_on_node+0x140/0x140
RIP [<ffffffffa050828a>] rbd_dev_refresh+0xfa/0x180 [rbd]
If an error occurs during rbd map, we have to error out, potentially
tearing down a watch. Just like on rbd unmap, notifies have to be
flushed, otherwise rbd_watch_cb() may end up trying to read in the
image header after rbd_dev_image_release() has run:
Assertion failure in rbd_dev_header_info() at line 4722:
rbd_assert(rbd_image_format_valid(rbd_dev->image_format));
Call Trace:
[<ffffffff81cccee0>] ? rbd_parent_request_create+0x150/0x150
[<ffffffff81cd4e59>] rbd_dev_refresh+0x59/0x390
[<ffffffff81cd5229>] rbd_watch_cb+0x69/0x290
[<ffffffff81fde9bf>] do_event_work+0x10f/0x1c0
[<ffffffff81107799>] process_one_work+0x689/0x1a80
[<ffffffff811076f7>] ? process_one_work+0x5e7/0x1a80
[<ffffffff81132065>] ? finish_task_switch+0x225/0x640
[<ffffffff81107110>] ? pwq_dec_nr_in_flight+0x2b0/0x2b0
[<ffffffff81108c69>] worker_thread+0xd9/0x1320
[<ffffffff81108b90>] ? process_one_work+0x1a80/0x1a80
[<ffffffff8111b02d>] kthread+0x21d/0x2e0
[<ffffffff8111ae10>] ? kthread_stop+0x550/0x550
[<ffffffff82022802>] ret_from_fork+0x22/0x40
[<ffffffff8111ae10>] ? kthread_stop+0x550/0x550
RIP [<ffffffff81ccd8f9>] rbd_dev_header_info+0xa19/0x1e30
To fix this, a) check if RBD_DEV_FLAG_EXISTS is set before calling
revalidate_disk(), b) move ceph_osdc_flush_notifies() call into
rbd_dev_header_unwatch_sync() to cover rbd map error paths and c) turn
header read-in into a critical section. The latter also happens to
take care of rbd map foo@bar vs rbd snap rm foo@bar race.
Fixes: http://tracker.ceph.com/issues/15490
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2016-04-15 16:22:16 +02:00
|
|
|
|
|
|
|
|
|
2012-10-30 15:47:17 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-27 09:59:30 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-04-29 20:01:25 +02:00
|
|
|
|
2013-04-27 09:59:30 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-04-29 20:01:25 +02:00
|
|
|
|
|
|
|
|
|
2013-04-27 09:59:30 -05:00
|
|
|
|
2016-04-29 20:01:25 +02:00
|
|
|
|
|
|
|
|
|
2013-04-27 09:59:30 -05:00
|
|
|
|
2016-04-29 20:01:25 +02:00
|
|
|
|
2013-04-27 09:59:30 -05:00
|
|
|
|
|
|
|
|
|
2013-04-28 23:32:34 -05:00
|
|
|
|
|
|
|
|
|
2013-04-28 23:32:34 -05:00
|
|
|
|
2017-04-13 12:17:37 +02:00
|
|
|
|
|
|
|
|
|
2013-04-28 23:32:34 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-28 23:32:34 -05:00
|
|
|
|
|
|
|
|
|
2012-07-10 20:30:11 -05:00
|
|
|
|
|
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-10 20:30:11 -05:00
|
|
|
|
2015-10-11 19:38:00 +02:00
|
|
|
|
2012-07-10 20:30:11 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-13 20:35:37 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-10 20:30:11 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-25 23:15:08 -05:00
|
|
|
|
|
|
|
|
|
2013-04-27 09:59:30 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-11 19:38:00 +02:00
|
|
|
|
2016-08-12 16:11:41 +02:00
|
|
|
|
2015-03-05 10:47:22 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-04-29 20:01:25 +02:00
|
|
|
|
2015-03-05 10:47:22 +03:00
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
2013-04-27 09:59:31 -05:00
|
|
|
|
2014-07-23 17:11:19 +04:00
|
|
|
|
2013-04-25 23:15:08 -05:00
|
|
|
|
2013-04-27 09:59:31 -05:00
|
|
|
|
2012-10-30 15:47:17 -05:00
|
|
|
|
2014-07-23 17:11:20 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-11 19:38:00 +02:00
|
|
|
|
2014-07-23 17:11:20 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-05 10:47:22 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-30 00:44:33 -05:00
|
|
|
|
2015-03-05 10:47:22 +03:00
|
|
|
|
2013-04-27 09:59:30 -05:00
|
|
|
|
2014-07-24 10:42:13 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-11 19:38:00 +02:00
|
|
|
|
2014-07-24 10:42:13 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-11 19:38:00 +02:00
|
|
|
|
2013-05-06 09:51:30 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-04-29 20:01:25 +02:00
|
|
|
|
2013-05-06 09:51:30 -05:00
|
|
|
|
2014-07-24 10:42:13 +04:00
|
|
|
|
2013-04-28 23:32:34 -05:00
|
|
|
|
|
|
|
|
|
2013-04-27 09:59:31 -05:00
|
|
|
|
2015-10-11 19:38:00 +02:00
|
|
|
|
2016-08-12 16:11:41 +02:00
|
|
|
|
2013-04-27 09:59:30 -05:00
|
|
|
|
|
|
|
|
|
2013-04-25 23:15:08 -05:00
|
|
|
|
|
|
|
|
|
2012-07-10 20:30:11 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rbd: add support for single-major device number allocation scheme
Currently each rbd device is allocated its own major number, which
leads to a hard limit of 230-250 images mapped at once. This commit
adds support for a new single-major device number allocation scheme,
which is hidden behind a new single_major boolean module parameter and
is disabled by default for backwards compatibility reasons. (Old
userspace cannot correctly unmap images mapped under single-major
scheme and would essentially just unmap a random image, if that.)
$ rbd showmapped
id pool image snap device
0 rbd b100 - /dev/rbd0
1 rbd b101 - /dev/rbd1
2 rbd b102 - /dev/rbd2
3 rbd b103 - /dev/rbd3
Old scheme (modprobe rbd):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:24 /dev/rbd0
brw-rw---- 1 root disk 252, 0 Dec 10 12:28 /dev/rbd1
brw-rw---- 1 root disk 252, 1 Dec 10 12:28 /dev/rbd1p1
brw-rw---- 1 root disk 252, 2 Dec 10 12:28 /dev/rbd1p2
brw-rw---- 1 root disk 252, 3 Dec 10 12:28 /dev/rbd1p3
brw-rw---- 1 root disk 251, 0 Dec 10 12:28 /dev/rbd2
brw-rw---- 1 root disk 251, 1 Dec 10 12:28 /dev/rbd2p1
brw-rw---- 1 root disk 250, 0 Dec 10 12:24 /dev/rbd3
New scheme (modprobe rbd single_major=Y):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:30 /dev/rbd0
brw-rw---- 1 root disk 253, 256 Dec 10 12:30 /dev/rbd1
brw-rw---- 1 root disk 253, 257 Dec 10 12:30 /dev/rbd1p1
brw-rw---- 1 root disk 253, 258 Dec 10 12:30 /dev/rbd1p2
brw-rw---- 1 root disk 253, 259 Dec 10 12:30 /dev/rbd1p3
brw-rw---- 1 root disk 253, 512 Dec 10 12:30 /dev/rbd2
brw-rw---- 1 root disk 253, 513 Dec 10 12:30 /dev/rbd2p1
brw-rw---- 1 root disk 253, 768 Dec 10 12:30 /dev/rbd3
(major 253 was assigned dynamically at module load time)
The new limit is 4096 images mapped at once, and it comes from the fact
that, as before, 256 minor numbers are reserved for each mapping.
(A follow-up commit changes the number of minors reserved and the way
we deal with partitions over that number.)
If single_major is set to true, two new sysfs interfaces show up:
/sys/bus/rbd/{add,remove}_single_major. These are to be used instead
of /sys/bus/rbd/{add,remove}, which are disabled for backwards
compatibility reasons outlined above.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-13 15:28:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2012-07-09 21:04:23 -05:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2015-10-15 15:38:57 +02:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2015-10-16 17:09:24 +02:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2014-05-13 11:19:27 +04:00
|
|
|
|
2015-03-05 10:47:22 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2015-03-05 10:47:22 +03:00
|
|
|
|
2013-04-26 09:43:47 -05:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2015-06-22 13:24:48 +03:00
|
|
|
|
2015-10-15 15:38:57 +02:00
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2015-10-15 15:38:57 +02:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
|
|
|
|
|
2015-06-22 13:24:48 +03:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2016-08-18 18:38:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rbd: fix rbd map vs notify races
A while ago, commit 9875201e1049 ("rbd: fix use-after free of
rbd_dev->disk") fixed rbd unmap vs notify race by introducing
an exported wrapper for flushing notifies and sticking it into
do_rbd_remove().
A similar problem exists on the rbd map path, though: the watch is
registered in rbd_dev_image_probe(), while the disk is set up quite
a few steps later, in rbd_dev_device_setup(). Nothing prevents
a notify from coming in and crashing on a NULL rbd_dev->disk:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000050
Call Trace:
[<ffffffffa0508344>] rbd_watch_cb+0x34/0x180 [rbd]
[<ffffffffa04bd290>] do_event_work+0x40/0xb0 [libceph]
[<ffffffff8109d5db>] process_one_work+0x17b/0x470
[<ffffffff8109e3ab>] worker_thread+0x11b/0x400
[<ffffffff8109e290>] ? rescuer_thread+0x400/0x400
[<ffffffff810a5acf>] kthread+0xcf/0xe0
[<ffffffff810b41b3>] ? finish_task_switch+0x53/0x170
[<ffffffff810a5a00>] ? kthread_create_on_node+0x140/0x140
[<ffffffff81645dd8>] ret_from_fork+0x58/0x90
[<ffffffff810a5a00>] ? kthread_create_on_node+0x140/0x140
RIP [<ffffffffa050828a>] rbd_dev_refresh+0xfa/0x180 [rbd]
If an error occurs during rbd map, we have to error out, potentially
tearing down a watch. Just like on rbd unmap, notifies have to be
flushed, otherwise rbd_watch_cb() may end up trying to read in the
image header after rbd_dev_image_release() has run:
Assertion failure in rbd_dev_header_info() at line 4722:
rbd_assert(rbd_image_format_valid(rbd_dev->image_format));
Call Trace:
[<ffffffff81cccee0>] ? rbd_parent_request_create+0x150/0x150
[<ffffffff81cd4e59>] rbd_dev_refresh+0x59/0x390
[<ffffffff81cd5229>] rbd_watch_cb+0x69/0x290
[<ffffffff81fde9bf>] do_event_work+0x10f/0x1c0
[<ffffffff81107799>] process_one_work+0x689/0x1a80
[<ffffffff811076f7>] ? process_one_work+0x5e7/0x1a80
[<ffffffff81132065>] ? finish_task_switch+0x225/0x640
[<ffffffff81107110>] ? pwq_dec_nr_in_flight+0x2b0/0x2b0
[<ffffffff81108c69>] worker_thread+0xd9/0x1320
[<ffffffff81108b90>] ? process_one_work+0x1a80/0x1a80
[<ffffffff8111b02d>] kthread+0x21d/0x2e0
[<ffffffff8111ae10>] ? kthread_stop+0x550/0x550
[<ffffffff82022802>] ret_from_fork+0x22/0x40
[<ffffffff8111ae10>] ? kthread_stop+0x550/0x550
RIP [<ffffffff81ccd8f9>] rbd_dev_header_info+0xa19/0x1e30
To fix this, a) check if RBD_DEV_FLAG_EXISTS is set before calling
revalidate_disk(), b) move ceph_osdc_flush_notifies() call into
rbd_dev_header_unwatch_sync() to cover rbd map error paths and c) turn
header read-in into a critical section. The latter also happens to
take care of rbd map foo@bar vs rbd snap rm foo@bar race.
Fixes: http://tracker.ceph.com/issues/15490
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2016-04-15 16:22:16 +02:00
|
|
|
|
2015-10-11 19:38:00 +02:00
|
|
|
|
2016-08-18 18:38:45 +02:00
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2016-08-18 18:38:45 +02:00
|
|
|
|
2012-08-29 17:11:07 -05:00
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
|
|
|
|
|
2017-10-12 12:35:19 +02:00
|
|
|
|
2013-05-06 17:40:33 -05:00
|
|
|
|
2013-04-28 23:32:34 -05:00
|
|
|
|
2017-04-13 12:17:37 +02:00
|
|
|
|
2017-04-13 12:17:37 +02:00
|
|
|
|
2013-05-13 20:35:37 -05:00
|
|
|
|
2017-04-13 12:17:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-13 20:35:37 -05:00
|
|
|
|
|
|
|
|
|
2017-04-13 12:17:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-13 12:17:39 +02:00
|
|
|
|
2017-04-13 12:17:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-16 17:09:24 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-28 23:32:34 -05:00
|
|
|
|
2017-04-13 12:17:39 +02:00
|
|
|
|
|
|
|
|
|
2017-04-13 12:17:38 +02:00
|
|
|
|
|
|
|
|
|
2017-04-13 12:17:37 +02:00
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
|
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2012-10-25 23:34:41 -05:00
|
|
|
|
2012-10-25 23:34:42 -05:00
|
|
|
|
2015-06-22 13:24:48 +03:00
|
|
|
|
2015-10-16 17:09:24 +02:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
rbd: add support for single-major device number allocation scheme
Currently each rbd device is allocated its own major number, which
leads to a hard limit of 230-250 images mapped at once. This commit
adds support for a new single-major device number allocation scheme,
which is hidden behind a new single_major boolean module parameter and
is disabled by default for backwards compatibility reasons. (Old
userspace cannot correctly unmap images mapped under single-major
scheme and would essentially just unmap a random image, if that.)
$ rbd showmapped
id pool image snap device
0 rbd b100 - /dev/rbd0
1 rbd b101 - /dev/rbd1
2 rbd b102 - /dev/rbd2
3 rbd b103 - /dev/rbd3
Old scheme (modprobe rbd):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:24 /dev/rbd0
brw-rw---- 1 root disk 252, 0 Dec 10 12:28 /dev/rbd1
brw-rw---- 1 root disk 252, 1 Dec 10 12:28 /dev/rbd1p1
brw-rw---- 1 root disk 252, 2 Dec 10 12:28 /dev/rbd1p2
brw-rw---- 1 root disk 252, 3 Dec 10 12:28 /dev/rbd1p3
brw-rw---- 1 root disk 251, 0 Dec 10 12:28 /dev/rbd2
brw-rw---- 1 root disk 251, 1 Dec 10 12:28 /dev/rbd2p1
brw-rw---- 1 root disk 250, 0 Dec 10 12:24 /dev/rbd3
New scheme (modprobe rbd single_major=Y):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:30 /dev/rbd0
brw-rw---- 1 root disk 253, 256 Dec 10 12:30 /dev/rbd1
brw-rw---- 1 root disk 253, 257 Dec 10 12:30 /dev/rbd1p1
brw-rw---- 1 root disk 253, 258 Dec 10 12:30 /dev/rbd1p2
brw-rw---- 1 root disk 253, 259 Dec 10 12:30 /dev/rbd1p3
brw-rw---- 1 root disk 253, 512 Dec 10 12:30 /dev/rbd2
brw-rw---- 1 root disk 253, 513 Dec 10 12:30 /dev/rbd2p1
brw-rw---- 1 root disk 253, 768 Dec 10 12:30 /dev/rbd3
(major 253 was assigned dynamically at module load time)
The new limit is 4096 images mapped at once, and it comes from the fact
that, as before, 256 minor numbers are reserved for each mapping.
(A follow-up commit changes the number of minors reserved and the way
we deal with partitions over that number.)
If single_major is set to true, two new sysfs interfaces show up:
/sys/bus/rbd/{add,remove}_single_major. These are to be used instead
of /sys/bus/rbd/{add,remove}, which are disabled for backwards
compatibility reasons outlined above.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-13 15:28:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-26 15:44:36 -05:00
|
|
|
|
|
|
|
|
|
2013-04-26 15:44:36 -05:00
|
|
|
|
2013-04-26 15:44:36 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-26 15:44:36 -05:00
|
|
|
|
2013-04-28 23:32:34 -05:00
|
|
|
|
2017-04-13 12:17:37 +02:00
|
|
|
|
2013-04-26 15:44:36 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-26 15:44:36 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rbd: add support for single-major device number allocation scheme
Currently each rbd device is allocated its own major number, which
leads to a hard limit of 230-250 images mapped at once. This commit
adds support for a new single-major device number allocation scheme,
which is hidden behind a new single_major boolean module parameter and
is disabled by default for backwards compatibility reasons. (Old
userspace cannot correctly unmap images mapped under single-major
scheme and would essentially just unmap a random image, if that.)
$ rbd showmapped
id pool image snap device
0 rbd b100 - /dev/rbd0
1 rbd b101 - /dev/rbd1
2 rbd b102 - /dev/rbd2
3 rbd b103 - /dev/rbd3
Old scheme (modprobe rbd):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:24 /dev/rbd0
brw-rw---- 1 root disk 252, 0 Dec 10 12:28 /dev/rbd1
brw-rw---- 1 root disk 252, 1 Dec 10 12:28 /dev/rbd1p1
brw-rw---- 1 root disk 252, 2 Dec 10 12:28 /dev/rbd1p2
brw-rw---- 1 root disk 252, 3 Dec 10 12:28 /dev/rbd1p3
brw-rw---- 1 root disk 251, 0 Dec 10 12:28 /dev/rbd2
brw-rw---- 1 root disk 251, 1 Dec 10 12:28 /dev/rbd2p1
brw-rw---- 1 root disk 250, 0 Dec 10 12:24 /dev/rbd3
New scheme (modprobe rbd single_major=Y):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:30 /dev/rbd0
brw-rw---- 1 root disk 253, 256 Dec 10 12:30 /dev/rbd1
brw-rw---- 1 root disk 253, 257 Dec 10 12:30 /dev/rbd1p1
brw-rw---- 1 root disk 253, 258 Dec 10 12:30 /dev/rbd1p2
brw-rw---- 1 root disk 253, 259 Dec 10 12:30 /dev/rbd1p3
brw-rw---- 1 root disk 253, 512 Dec 10 12:30 /dev/rbd2
brw-rw---- 1 root disk 253, 513 Dec 10 12:30 /dev/rbd2p1
brw-rw---- 1 root disk 253, 768 Dec 10 12:30 /dev/rbd3
(major 253 was assigned dynamically at module load time)
The new limit is 4096 images mapped at once, and it comes from the fact
that, as before, 256 minor numbers are reserved for each mapping.
(A follow-up commit changes the number of minors reserved and the way
we deal with partitions over that number.)
If single_major is set to true, two new sysfs interfaces show up:
/sys/bus/rbd/{add,remove}_single_major. These are to be used instead
of /sys/bus/rbd/{add,remove}, which are disabled for backwards
compatibility reasons outlined above.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-13 15:28:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2013-05-31 15:17:01 -05:00
|
|
|
|
|
|
|
|
|
2016-08-18 18:38:45 +02:00
|
|
|
|
2013-05-31 17:40:44 -05:00
|
|
|
|
2016-08-18 18:38:45 +02:00
|
|
|
|
2013-04-27 09:59:30 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2016-08-18 18:38:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2016-08-18 18:38:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2013-05-31 15:17:01 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-16 09:29:16 -06:00
|
|
|
|
2013-05-31 15:17:01 -05:00
|
|
|
|
|
|
|
|
|
2016-08-18 18:38:45 +02:00
|
|
|
|
2013-05-31 15:17:01 -05:00
|
|
|
|
|
|
|
|
|
2013-05-31 17:40:44 -05:00
|
|
|
|
|
|
|
|
|
2013-05-31 15:17:01 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-31 17:40:44 -05:00
|
|
|
|
2013-05-31 15:17:01 -05:00
|
|
|
|
2013-05-31 15:17:01 -05:00
|
|
|
|
2016-08-18 18:38:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-13 12:17:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-16 18:02:40 +02:00
|
|
|
|
2017-04-13 12:17:39 +02:00
|
|
|
|
2015-10-16 17:09:24 +02:00
|
|
|
|
2013-04-28 23:32:34 -05:00
|
|
|
|
2017-04-13 12:17:37 +02:00
|
|
|
|
2013-05-31 15:17:01 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
rbd: add support for single-major device number allocation scheme
Currently each rbd device is allocated its own major number, which
leads to a hard limit of 230-250 images mapped at once. This commit
adds support for a new single-major device number allocation scheme,
which is hidden behind a new single_major boolean module parameter and
is disabled by default for backwards compatibility reasons. (Old
userspace cannot correctly unmap images mapped under single-major
scheme and would essentially just unmap a random image, if that.)
$ rbd showmapped
id pool image snap device
0 rbd b100 - /dev/rbd0
1 rbd b101 - /dev/rbd1
2 rbd b102 - /dev/rbd2
3 rbd b103 - /dev/rbd3
Old scheme (modprobe rbd):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:24 /dev/rbd0
brw-rw---- 1 root disk 252, 0 Dec 10 12:28 /dev/rbd1
brw-rw---- 1 root disk 252, 1 Dec 10 12:28 /dev/rbd1p1
brw-rw---- 1 root disk 252, 2 Dec 10 12:28 /dev/rbd1p2
brw-rw---- 1 root disk 252, 3 Dec 10 12:28 /dev/rbd1p3
brw-rw---- 1 root disk 251, 0 Dec 10 12:28 /dev/rbd2
brw-rw---- 1 root disk 251, 1 Dec 10 12:28 /dev/rbd2p1
brw-rw---- 1 root disk 250, 0 Dec 10 12:24 /dev/rbd3
New scheme (modprobe rbd single_major=Y):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:30 /dev/rbd0
brw-rw---- 1 root disk 253, 256 Dec 10 12:30 /dev/rbd1
brw-rw---- 1 root disk 253, 257 Dec 10 12:30 /dev/rbd1p1
brw-rw---- 1 root disk 253, 258 Dec 10 12:30 /dev/rbd1p2
brw-rw---- 1 root disk 253, 259 Dec 10 12:30 /dev/rbd1p3
brw-rw---- 1 root disk 253, 512 Dec 10 12:30 /dev/rbd2
brw-rw---- 1 root disk 253, 513 Dec 10 12:30 /dev/rbd2p1
brw-rw---- 1 root disk 253, 768 Dec 10 12:30 /dev/rbd3
(major 253 was assigned dynamically at module load time)
The new limit is 4096 images mapped at once, and it comes from the fact
that, as before, 256 minor numbers are reserved for each mapping.
(A follow-up commit changes the number of minors reserved and the way
we deal with partitions over that number.)
If single_major is set to true, two new sysfs interfaces show up:
/sys/bus/rbd/{add,remove}_single_major. These are to be used instead
of /sys/bus/rbd/{add,remove}, which are disabled for backwards
compatibility reasons outlined above.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-13 15:28:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2012-02-07 12:03:36 -06:00
|
|
|
|
2012-01-24 10:08:36 -06:00
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2012-02-07 12:03:36 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-11-19 14:51:04 -08:00
|
|
|
|
2012-02-07 12:03:36 -06:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2013-05-01 12:43:03 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-03-13 15:17:32 +08:00
|
|
|
|
2013-05-01 12:43:03 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-03-13 15:17:32 +08:00
|
|
|
|
2013-05-01 12:43:04 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rbd: use bio_clone_fast() instead of bio_clone()
bio_clone() makes a copy of the bi_io_vec, but rbd never changes that,
so there is no need for a copy.
bio_clone_fast() can be used instead, which avoids making the copy.
This requires that we provide a bio_set. bio_clone() uses fs_bio_set,
but it isn't, in general, safe to use the same bio_set at different
levels of the stack, as that can lead to deadlocks. As filesystems
use fs_bio_set, block devices shouldn't.
As rbd never stacks, it is safe to have a single global bio_set for
all rbd devices to use. So allocate that when the module is
initialised, and use it with bio_clone_fast().
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2017-06-18 14:38:58 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:23 +01:00
|
|
|
|
2013-05-01 12:43:03 -05:00
|
|
|
|
rbd: use bio_clone_fast() instead of bio_clone()
bio_clone() makes a copy of the bi_io_vec, but rbd never changes that,
so there is no need for a copy.
bio_clone_fast() can be used instead, which avoids making the copy.
This requires that we provide a bio_set. bio_clone() uses fs_bio_set,
but it isn't, in general, safe to use the same bio_set at different
levels of the stack, as that can lead to deadlocks. As filesystems
use fs_bio_set, block devices shouldn't.
As rbd never stacks, it is safe to have a single global bio_set for
all rbd devices to use. So allocate that when the module is
initialised, and use it with bio_clone_fast().
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2017-06-18 14:38:58 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-25 18:16:23 +01:00
|
|
|
|
2013-05-01 12:43:03 -05:00
|
|
|
|
|
|
|
|
|
2013-05-01 12:43:03 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-01 12:43:03 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-01 12:43:03 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rbd: use bio_clone_fast() instead of bio_clone()
bio_clone() makes a copy of the bi_io_vec, but rbd never changes that,
so there is no need for a copy.
bio_clone_fast() can be used instead, which avoids making the copy.
This requires that we provide a bio_set. bio_clone() uses fs_bio_set,
but it isn't, in general, safe to use the same bio_set at different
levels of the stack, as that can lead to deadlocks. As filesystems
use fs_bio_set, block devices shouldn't.
As rbd never stacks, it is safe to have a single global bio_set for
all rbd devices to use. So allocate that when the module is
initialised, and use it with bio_clone_fast().
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2017-06-18 14:38:58 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-01 12:43:03 -05:00
|
|
|
|
|
|
|
|
|
2013-02-19 12:25:56 -06:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-30 11:13:33 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-13 15:28:57 +02:00
|
|
|
|
2013-05-01 12:43:03 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2013-12-13 15:28:57 +02:00
|
|
|
|
2014-10-09 17:06:01 +04:00
|
|
|
|
|
|
|
|
|
2015-04-22 18:28:13 +03:00
|
|
|
|
2014-10-09 17:06:01 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rbd: add support for single-major device number allocation scheme
Currently each rbd device is allocated its own major number, which
leads to a hard limit of 230-250 images mapped at once. This commit
adds support for a new single-major device number allocation scheme,
which is hidden behind a new single_major boolean module parameter and
is disabled by default for backwards compatibility reasons. (Old
userspace cannot correctly unmap images mapped under single-major
scheme and would essentially just unmap a random image, if that.)
$ rbd showmapped
id pool image snap device
0 rbd b100 - /dev/rbd0
1 rbd b101 - /dev/rbd1
2 rbd b102 - /dev/rbd2
3 rbd b103 - /dev/rbd3
Old scheme (modprobe rbd):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:24 /dev/rbd0
brw-rw---- 1 root disk 252, 0 Dec 10 12:28 /dev/rbd1
brw-rw---- 1 root disk 252, 1 Dec 10 12:28 /dev/rbd1p1
brw-rw---- 1 root disk 252, 2 Dec 10 12:28 /dev/rbd1p2
brw-rw---- 1 root disk 252, 3 Dec 10 12:28 /dev/rbd1p3
brw-rw---- 1 root disk 251, 0 Dec 10 12:28 /dev/rbd2
brw-rw---- 1 root disk 251, 1 Dec 10 12:28 /dev/rbd2p1
brw-rw---- 1 root disk 250, 0 Dec 10 12:24 /dev/rbd3
New scheme (modprobe rbd single_major=Y):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:30 /dev/rbd0
brw-rw---- 1 root disk 253, 256 Dec 10 12:30 /dev/rbd1
brw-rw---- 1 root disk 253, 257 Dec 10 12:30 /dev/rbd1p1
brw-rw---- 1 root disk 253, 258 Dec 10 12:30 /dev/rbd1p2
brw-rw---- 1 root disk 253, 259 Dec 10 12:30 /dev/rbd1p3
brw-rw---- 1 root disk 253, 512 Dec 10 12:30 /dev/rbd2
brw-rw---- 1 root disk 253, 513 Dec 10 12:30 /dev/rbd2p1
brw-rw---- 1 root disk 253, 768 Dec 10 12:30 /dev/rbd3
(major 253 was assigned dynamically at module load time)
The new limit is 4096 images mapped at once, and it comes from the fact
that, as before, 256 minor numbers are reserved for each mapping.
(A follow-up commit changes the number of minors reserved and the way
we deal with partitions over that number.)
If single_major is set to true, two new sysfs interfaces show up:
/sys/bus/rbd/{add,remove}_single_major. These are to be used instead
of /sys/bus/rbd/{add,remove}, which are disabled for backwards
compatibility reasons outlined above.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-13 15:28:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-10-09 17:06:01 +04:00
|
|
|
|
rbd: add support for single-major device number allocation scheme
Currently each rbd device is allocated its own major number, which
leads to a hard limit of 230-250 images mapped at once. This commit
adds support for a new single-major device number allocation scheme,
which is hidden behind a new single_major boolean module parameter and
is disabled by default for backwards compatibility reasons. (Old
userspace cannot correctly unmap images mapped under single-major
scheme and would essentially just unmap a random image, if that.)
$ rbd showmapped
id pool image snap device
0 rbd b100 - /dev/rbd0
1 rbd b101 - /dev/rbd1
2 rbd b102 - /dev/rbd2
3 rbd b103 - /dev/rbd3
Old scheme (modprobe rbd):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:24 /dev/rbd0
brw-rw---- 1 root disk 252, 0 Dec 10 12:28 /dev/rbd1
brw-rw---- 1 root disk 252, 1 Dec 10 12:28 /dev/rbd1p1
brw-rw---- 1 root disk 252, 2 Dec 10 12:28 /dev/rbd1p2
brw-rw---- 1 root disk 252, 3 Dec 10 12:28 /dev/rbd1p3
brw-rw---- 1 root disk 251, 0 Dec 10 12:28 /dev/rbd2
brw-rw---- 1 root disk 251, 1 Dec 10 12:28 /dev/rbd2p1
brw-rw---- 1 root disk 250, 0 Dec 10 12:24 /dev/rbd3
New scheme (modprobe rbd single_major=Y):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:30 /dev/rbd0
brw-rw---- 1 root disk 253, 256 Dec 10 12:30 /dev/rbd1
brw-rw---- 1 root disk 253, 257 Dec 10 12:30 /dev/rbd1p1
brw-rw---- 1 root disk 253, 258 Dec 10 12:30 /dev/rbd1p2
brw-rw---- 1 root disk 253, 259 Dec 10 12:30 /dev/rbd1p3
brw-rw---- 1 root disk 253, 512 Dec 10 12:30 /dev/rbd2
brw-rw---- 1 root disk 253, 513 Dec 10 12:30 /dev/rbd2p1
brw-rw---- 1 root disk 253, 768 Dec 10 12:30 /dev/rbd3
(major 253 was assigned dynamically at module load time)
The new limit is 4096 images mapped at once, and it comes from the fact
that, as before, 256 minor numbers are reserved for each mapping.
(A follow-up commit changes the number of minors reserved and the way
we deal with partitions over that number.)
If single_major is set to true, two new sysfs interfaces show up:
/sys/bus/rbd/{add,remove}_single_major. These are to be used instead
of /sys/bus/rbd/{add,remove}, which are disabled for backwards
compatibility reasons outlined above.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-13 15:28:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-01 12:43:03 -05:00
|
|
|
|
|
|
|
|
|
rbd: add support for single-major device number allocation scheme
Currently each rbd device is allocated its own major number, which
leads to a hard limit of 230-250 images mapped at once. This commit
adds support for a new single-major device number allocation scheme,
which is hidden behind a new single_major boolean module parameter and
is disabled by default for backwards compatibility reasons. (Old
userspace cannot correctly unmap images mapped under single-major
scheme and would essentially just unmap a random image, if that.)
$ rbd showmapped
id pool image snap device
0 rbd b100 - /dev/rbd0
1 rbd b101 - /dev/rbd1
2 rbd b102 - /dev/rbd2
3 rbd b103 - /dev/rbd3
Old scheme (modprobe rbd):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:24 /dev/rbd0
brw-rw---- 1 root disk 252, 0 Dec 10 12:28 /dev/rbd1
brw-rw---- 1 root disk 252, 1 Dec 10 12:28 /dev/rbd1p1
brw-rw---- 1 root disk 252, 2 Dec 10 12:28 /dev/rbd1p2
brw-rw---- 1 root disk 252, 3 Dec 10 12:28 /dev/rbd1p3
brw-rw---- 1 root disk 251, 0 Dec 10 12:28 /dev/rbd2
brw-rw---- 1 root disk 251, 1 Dec 10 12:28 /dev/rbd2p1
brw-rw---- 1 root disk 250, 0 Dec 10 12:24 /dev/rbd3
New scheme (modprobe rbd single_major=Y):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:30 /dev/rbd0
brw-rw---- 1 root disk 253, 256 Dec 10 12:30 /dev/rbd1
brw-rw---- 1 root disk 253, 257 Dec 10 12:30 /dev/rbd1p1
brw-rw---- 1 root disk 253, 258 Dec 10 12:30 /dev/rbd1p2
brw-rw---- 1 root disk 253, 259 Dec 10 12:30 /dev/rbd1p3
brw-rw---- 1 root disk 253, 512 Dec 10 12:30 /dev/rbd2
brw-rw---- 1 root disk 253, 513 Dec 10 12:30 /dev/rbd2p1
brw-rw---- 1 root disk 253, 768 Dec 10 12:30 /dev/rbd3
(major 253 was assigned dynamically at module load time)
The new limit is 4096 images mapped at once, and it comes from the fact
that, as before, 256 minor numbers are reserved for each mapping.
(A follow-up commit changes the number of minors reserved and the way
we deal with partitions over that number.)
If single_major is set to true, two new sysfs interfaces show up:
/sys/bus/rbd/{add,remove}_single_major. These are to be used instead
of /sys/bus/rbd/{add,remove}, which are disabled for backwards
compatibility reasons outlined above.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-13 15:28:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-01 12:43:03 -05:00
|
|
|
|
2013-12-13 15:28:57 +02:00
|
|
|
|
|
|
|
|
|
rbd: add support for single-major device number allocation scheme
Currently each rbd device is allocated its own major number, which
leads to a hard limit of 230-250 images mapped at once. This commit
adds support for a new single-major device number allocation scheme,
which is hidden behind a new single_major boolean module parameter and
is disabled by default for backwards compatibility reasons. (Old
userspace cannot correctly unmap images mapped under single-major
scheme and would essentially just unmap a random image, if that.)
$ rbd showmapped
id pool image snap device
0 rbd b100 - /dev/rbd0
1 rbd b101 - /dev/rbd1
2 rbd b102 - /dev/rbd2
3 rbd b103 - /dev/rbd3
Old scheme (modprobe rbd):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:24 /dev/rbd0
brw-rw---- 1 root disk 252, 0 Dec 10 12:28 /dev/rbd1
brw-rw---- 1 root disk 252, 1 Dec 10 12:28 /dev/rbd1p1
brw-rw---- 1 root disk 252, 2 Dec 10 12:28 /dev/rbd1p2
brw-rw---- 1 root disk 252, 3 Dec 10 12:28 /dev/rbd1p3
brw-rw---- 1 root disk 251, 0 Dec 10 12:28 /dev/rbd2
brw-rw---- 1 root disk 251, 1 Dec 10 12:28 /dev/rbd2p1
brw-rw---- 1 root disk 250, 0 Dec 10 12:24 /dev/rbd3
New scheme (modprobe rbd single_major=Y):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:30 /dev/rbd0
brw-rw---- 1 root disk 253, 256 Dec 10 12:30 /dev/rbd1
brw-rw---- 1 root disk 253, 257 Dec 10 12:30 /dev/rbd1p1
brw-rw---- 1 root disk 253, 258 Dec 10 12:30 /dev/rbd1p2
brw-rw---- 1 root disk 253, 259 Dec 10 12:30 /dev/rbd1p3
brw-rw---- 1 root disk 253, 512 Dec 10 12:30 /dev/rbd2
brw-rw---- 1 root disk 253, 513 Dec 10 12:30 /dev/rbd2p1
brw-rw---- 1 root disk 253, 768 Dec 10 12:30 /dev/rbd3
(major 253 was assigned dynamically at module load time)
The new limit is 4096 images mapped at once, and it comes from the fact
that, as before, 256 minor numbers are reserved for each mapping.
(A follow-up commit changes the number of minors reserved and the way
we deal with partitions over that number.)
If single_major is set to true, two new sysfs interfaces show up:
/sys/bus/rbd/{add,remove}_single_major. These are to be used instead
of /sys/bus/rbd/{add,remove}, which are disabled for backwards
compatibility reasons outlined above.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-13 15:28:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-10-09 17:06:01 +04:00
|
|
|
|
|
|
|
|
|
2013-12-13 15:28:57 +02:00
|
|
|
|
|
|
|
|
|
2013-05-01 12:43:03 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
2013-02-19 12:25:56 -06:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
2014-05-20 15:46:04 +04:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
rbd: add support for single-major device number allocation scheme
Currently each rbd device is allocated its own major number, which
leads to a hard limit of 230-250 images mapped at once. This commit
adds support for a new single-major device number allocation scheme,
which is hidden behind a new single_major boolean module parameter and
is disabled by default for backwards compatibility reasons. (Old
userspace cannot correctly unmap images mapped under single-major
scheme and would essentially just unmap a random image, if that.)
$ rbd showmapped
id pool image snap device
0 rbd b100 - /dev/rbd0
1 rbd b101 - /dev/rbd1
2 rbd b102 - /dev/rbd2
3 rbd b103 - /dev/rbd3
Old scheme (modprobe rbd):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:24 /dev/rbd0
brw-rw---- 1 root disk 252, 0 Dec 10 12:28 /dev/rbd1
brw-rw---- 1 root disk 252, 1 Dec 10 12:28 /dev/rbd1p1
brw-rw---- 1 root disk 252, 2 Dec 10 12:28 /dev/rbd1p2
brw-rw---- 1 root disk 252, 3 Dec 10 12:28 /dev/rbd1p3
brw-rw---- 1 root disk 251, 0 Dec 10 12:28 /dev/rbd2
brw-rw---- 1 root disk 251, 1 Dec 10 12:28 /dev/rbd2p1
brw-rw---- 1 root disk 250, 0 Dec 10 12:24 /dev/rbd3
New scheme (modprobe rbd single_major=Y):
$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:30 /dev/rbd0
brw-rw---- 1 root disk 253, 256 Dec 10 12:30 /dev/rbd1
brw-rw---- 1 root disk 253, 257 Dec 10 12:30 /dev/rbd1p1
brw-rw---- 1 root disk 253, 258 Dec 10 12:30 /dev/rbd1p2
brw-rw---- 1 root disk 253, 259 Dec 10 12:30 /dev/rbd1p3
brw-rw---- 1 root disk 253, 512 Dec 10 12:30 /dev/rbd2
brw-rw---- 1 root disk 253, 513 Dec 10 12:30 /dev/rbd2p1
brw-rw---- 1 root disk 253, 768 Dec 10 12:30 /dev/rbd3
(major 253 was assigned dynamically at module load time)
The new limit is 4096 images mapped at once, and it comes from the fact
that, as before, 256 minor numbers are reserved for each mapping.
(A follow-up commit changes the number of minors reserved and the way
we deal with partitions over that number.)
If single_major is set to true, two new sysfs interfaces show up:
/sys/bus/rbd/{add,remove}_single_major. These are to be used instead
of /sys/bus/rbd/{add,remove}, which are disabled for backwards
compatibility reasons outlined above.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-13 15:28:57 +02:00
|
|
|
|
|
|
|
|
|
2014-10-09 17:06:01 +04:00
|
|
|
|
2013-05-01 12:43:03 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-31 20:13:09 -05:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-13 15:28:56 +02:00
|
|
|
|
2010-08-12 16:11:25 -07:00
|
|
|
|