NeilBrown
4b80991c6c
md: Protect access to mddev->disks list using RCU
...
All modifications and most access to the mddev->disks list are made
under the reconfig_mutex lock. However there are three places where
the list is walked without any locking. If a reconfig happens at this
time, havoc (and oops) can ensue.
So use RCU to protect these accesses:
- wrap them in rcu_read_{,un}lock()
- use list_for_each_entry_rcu
- add to the list with list_add_rcu
- delete from the list with list_del_rcu
- delay the 'free' with call_rcu rather than schedule_work
Note that export_rdev did a list_del_init on this list. In almost all
cases the entry was not in the list anymore so it was a no-op and so
safe. It is no longer safe as after list_del_rcu we may not touch
the list_head.
An audit shows that export_rdev is called:
- after unbind_rdev_from_array, in which case the delete has
already been done,
- after bind_rdev_to_array fails, in which case the delete isn't needed.
- before the device has been put on a list at all (e.g. in
add_new_disk where reading the superblock fails).
- and in autorun devices after a failure when the device is on a
different list.
So remove the list_del_init call from export_rdev, and add it back
immediately before the called to export_rdev for that last case.
Note also that ->same_set is sometimes used for lists other than
mddev->list (e.g. candidates). In these cases rcu is not needed.
Signed-off-by: NeilBrown <neilb@suse.de>
2008-07-21 17:05:25 +10:00
..
2008-04-30 08:29:54 -07:00
2008-05-18 20:49:41 +02:00
2008-04-29 13:46:50 -07:00
2008-06-06 11:29:10 -07:00
2008-05-08 01:15:21 -07:00
2008-05-21 14:08:38 -07:00
2008-05-21 14:08:38 -07:00
2008-05-21 14:08:38 -07:00
2008-07-21 17:05:25 +10:00
2008-06-02 15:27:10 -07:00
2008-06-09 15:53:37 -04:00
2008-05-19 07:34:01 -05:00
2008-04-29 08:06:27 -07:00
2008-05-20 14:14:15 -07:00
2008-06-16 10:20:58 -07:00
2008-06-19 10:42:17 +10:00
2008-06-19 10:42:17 +10:00
2008-04-29 08:06:00 -07:00
2008-05-01 13:08:50 -04:00
2008-05-14 23:24:09 -07:00
2008-05-14 23:24:09 -07:00
2008-06-24 23:36:35 -04:00
2008-04-30 08:29:50 -07:00
2008-05-16 17:23:05 -04:00
2008-04-29 09:50:34 +02:00
2008-05-13 08:02:25 -07:00
2008-04-29 08:11:16 -07:00
2008-06-06 11:29:10 -07:00
2008-04-29 12:36:54 -07:00
2008-05-28 14:49:27 +02:00
2008-06-21 11:25:10 -07:00
2008-04-29 08:06:01 -07:00
2008-04-28 08:58:19 -07:00
2008-07-04 10:40:08 -07:00
2008-04-30 08:29:54 -07:00
2008-07-04 10:40:05 -07:00
2008-04-29 08:06:09 -07:00
2008-04-29 08:06:10 -07:00
2008-05-01 08:03:59 -07:00
2008-04-30 08:29:54 -07:00
2008-04-29 08:05:59 -07:00
2008-05-01 08:03:59 -07:00
2008-04-30 08:42:49 -07:00
2008-05-10 19:51:16 -07:00
2008-04-30 08:29:54 -07:00
2008-04-30 08:29:54 -07:00
2008-04-29 08:06:06 -07:00
2008-04-30 08:29:52 -07:00
2008-04-29 08:05:59 -07:00
2008-04-28 16:27:08 -04:00
2008-06-11 19:13:45 -04:00
2008-07-04 10:40:09 -07:00
2008-04-28 08:58:19 -07:00
2008-04-30 08:29:54 -07:00
2008-06-23 11:52:30 -04:00
2008-07-05 13:10:50 -07:00
2008-04-30 08:29:53 -07:00
2008-04-29 08:06:09 -07:00
2008-04-30 08:29:54 -07:00
2008-05-29 21:10:01 -07:00
2008-04-30 08:29:48 -07:00
2008-04-29 08:06:11 -07:00
2008-04-29 08:06:11 -07:00
2008-04-28 08:58:30 -07:00
2008-04-29 08:06:26 -07:00
2008-04-29 08:06:16 -07:00
2008-04-30 08:29:54 -07:00
2008-05-07 09:48:23 +02:00
2008-04-28 08:58:35 -07:00
2008-05-16 17:22:26 -04:00
2008-05-01 13:08:16 -04:00
2008-07-04 10:40:04 -07:00
2008-07-01 09:07:34 +02:00
2008-04-30 08:29:54 -07:00
2008-04-30 08:29:54 -07:00
2008-05-13 08:02:26 -07:00
2008-04-30 08:29:45 -07:00
2008-05-14 10:37:57 -07:00
2008-04-29 08:05:58 -07:00
2008-05-24 09:56:13 -07:00
2008-05-10 20:58:02 -07:00
2008-05-20 16:44:43 +02:00
2008-05-20 16:44:43 +02:00
2008-05-03 18:11:48 +02:00
2008-04-28 08:58:25 -07:00
2008-04-30 08:29:54 -07:00
2008-04-29 23:11:38 +02:00
2008-07-01 22:38:18 +02:00
2008-04-30 08:29:54 -07:00
2008-07-08 19:27:22 +02:00
2008-04-29 08:06:25 -07:00
2008-04-30 20:34:26 -04:00
2008-05-02 16:53:33 -07:00
2008-04-30 08:29:54 -07:00
2008-06-16 16:48:20 -07:00
2008-06-03 16:36:01 -07:00
2008-06-27 20:09:00 -07:00
2008-04-30 08:29:54 -07:00
2008-06-03 16:37:33 -07:00
2008-05-16 17:22:20 -04:00
2008-04-29 08:06:03 -07:00
2008-06-30 09:25:12 -04:00
2008-04-29 08:06:02 -07:00
2008-05-05 16:47:14 +10:00
2008-06-11 19:13:46 -04:00
2008-05-07 09:51:23 +02:00
2008-04-29 08:06:13 -07:00
2008-04-29 08:06:15 -07:00
2008-04-29 08:06:15 -07:00
2008-06-10 12:39:35 -07:00
2008-05-02 13:40:34 +02:00
2008-04-29 03:22:15 -04:00
2008-04-30 08:29:54 -07:00
2008-06-06 17:50:40 -04:00
2008-05-01 08:03:58 -07:00
2008-05-15 17:50:37 -07:00
2008-06-27 23:13:54 +02:00
2008-04-29 08:06:29 -07:00
2008-07-05 13:10:50 -07:00
2008-04-29 08:06:17 -07:00
2008-04-29 08:06:16 -07:00
2008-04-30 08:29:54 -07:00
2008-05-05 07:13:21 -05:00
2008-04-30 16:52:58 -07:00
2008-04-30 08:29:54 -07:00
2008-04-30 08:29:54 -07:00
2008-04-28 08:58:32 -07:00
2008-04-30 08:29:54 -07:00
2008-07-04 10:40:05 -07:00
2008-06-24 12:16:59 +03:00
2008-06-04 06:40:41 -04:00
2008-04-30 08:29:54 -07:00
2008-04-29 15:57:53 +10:00
2008-06-12 10:47:58 +02:00
2008-04-29 08:06:01 -07:00
2008-04-29 08:06:10 -07:00
2008-06-09 11:32:41 +10:00
2008-04-29 08:06:12 -07:00
2008-04-28 08:58:25 -07:00
2008-05-13 08:02:25 -07:00
2008-06-12 18:05:41 -07:00
2008-05-24 09:56:09 -07:00
2008-05-24 09:56:13 -07:00
2008-05-26 16:08:40 +02:00
2008-05-01 21:14:59 +10:00
2008-04-30 08:29:54 -07:00
2008-06-08 11:58:43 -07:00
2008-06-06 11:29:12 -07:00
2008-04-29 09:11:12 -07:00
2008-04-28 21:17:07 -07:00
2008-04-29 08:06:24 -07:00
2008-04-30 08:29:54 -07:00
2008-04-28 08:58:29 -07:00
2008-06-27 19:54:54 -07:00
2008-05-21 14:08:38 -07:00
2008-04-28 06:18:03 -04:00
2008-04-28 08:58:19 -07:00
2008-04-29 08:06:13 -07:00
2008-04-30 08:29:54 -07:00
2008-05-09 20:22:58 +10:00
2008-04-28 08:58:18 -07:00
2008-06-09 10:22:24 -07:00
2008-05-14 19:23:25 -05:00
2008-07-04 10:40:09 -07:00
2008-06-12 10:12:42 +02:00
2008-05-03 03:39:55 +04:00
2008-05-14 19:11:14 -07:00
2008-04-29 08:06:02 -07:00
2008-04-29 08:06:02 -07:00
2008-05-06 12:01:41 -04:00
2008-04-30 08:29:49 -07:00
2008-04-30 08:29:49 -07:00
2008-04-30 08:29:54 -07:00
2008-04-30 11:52:52 -07:00
2008-04-30 08:29:53 -07:00
2008-05-01 13:07:28 -04:00
2008-04-28 08:58:26 -07:00
2008-06-12 18:05:40 -07:00
2008-04-30 08:29:54 -07:00
2008-04-30 08:29:50 -07:00
2008-04-30 08:29:38 -07:00
2008-05-01 08:04:01 -07:00
2008-04-28 08:58:33 -07:00
2008-04-30 08:29:54 -07:00
2008-07-04 10:40:07 -07:00
2008-05-10 19:51:16 -07:00
2008-04-30 08:29:54 -07:00
2008-04-30 08:29:54 -07:00
2008-04-30 08:29:51 -07:00
2008-04-28 08:58:46 -07:00
2008-04-29 08:06:10 -07:00
2008-04-29 08:05:59 -07:00
2008-04-30 08:29:54 -07:00
2008-05-03 10:01:33 -07:00
2008-06-10 15:44:49 -07:00
2008-04-30 08:29:54 -07:00
2008-06-10 11:37:25 +02:00
2008-07-04 10:40:08 -07:00
2008-04-29 08:06:16 -07:00
2008-04-30 08:29:54 -07:00
2008-04-28 08:58:32 -07:00
2008-06-03 08:20:17 -07:00
2008-04-28 08:58:25 -07:00
2008-04-30 08:29:34 -07:00
2008-07-04 10:40:04 -07:00
2008-07-04 10:40:04 -07:00
2008-05-24 09:56:12 -07:00
2008-04-30 08:29:54 -07:00
2008-04-30 08:29:54 -07:00
2008-04-29 08:06:05 -07:00
2008-05-01 08:03:59 -07:00
2008-04-28 08:58:36 -07:00
2008-04-30 08:29:54 -07:00
2008-04-28 08:58:20 -07:00
2008-04-28 08:58:29 -07:00
2008-04-29 08:06:06 -07:00
2008-04-29 08:06:23 -07:00
2008-05-04 17:07:03 -07:00
2008-04-29 08:06:27 -07:00
2008-06-12 16:34:35 -07:00
2008-04-30 08:29:54 -07:00
2008-06-25 19:25:42 -04:00
2008-04-30 08:29:37 -07:00
2008-06-12 10:48:00 +02:00
2008-04-30 08:29:53 -07:00
2008-05-01 08:03:59 -07:00
2008-05-29 14:46:30 +02:00
2008-06-23 10:36:47 -07:00
2008-06-06 11:29:10 -07:00
2008-05-24 09:56:09 -07:00
2008-05-09 07:45:18 -07:00
2008-06-05 06:35:47 -03:00
2008-05-30 15:09:45 +10:00
2008-05-30 15:09:46 +10:00
2008-06-10 18:20:30 -04:00
2008-05-30 15:09:44 +10:00
2008-05-02 21:50:50 +10:00
2008-04-28 08:58:21 -07:00
2008-04-28 08:58:23 -07:00
2008-05-01 17:38:35 -04:00
2008-05-27 01:37:26 -04:00
2008-04-30 08:29:49 -07:00
2008-04-29 08:06:06 -07:00
2008-07-10 16:55:37 -07:00