summaryrefslogtreecommitdiff
path: root/drivers/md/raid5.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2018-03-14 20:37:31 +0100
committerThomas Gleixner <tglx@linutronix.de>2018-03-14 20:37:31 +0100
commitb0d8bef8ed805ca92eb91e86acf3ce89cbebc8ce (patch)
tree8838391a76f0cf75ffcd31166996d03d19c580a6 /drivers/md/raid5.h
parent82b691bedf05f258f1c86c96ee574b0d7795c0a1 (diff)
parentfc6eabbbf8ef99efed778dd5afabc83c21dba585 (diff)
Merge branch 'linus' into irq/core to pick up dependencies.
Diffstat (limited to 'drivers/md/raid5.h')
-rw-r--r--drivers/md/raid5.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/md/raid5.h b/drivers/md/raid5.h
index 2e6123825095..3f8da26032ac 100644
--- a/drivers/md/raid5.h
+++ b/drivers/md/raid5.h
@@ -450,6 +450,18 @@ enum {
* HANDLE gets cleared if stripe_handle leaves nothing locked.
*/
+/* Note: disk_info.rdev can be set to NULL asynchronously by raid5_remove_disk.
+ * There are three safe ways to access disk_info.rdev.
+ * 1/ when holding mddev->reconfig_mutex
+ * 2/ when resync/recovery/reshape is known to be happening - i.e. in code that
+ * is called as part of performing resync/recovery/reshape.
+ * 3/ while holding rcu_read_lock(), use rcu_dereference to get the pointer
+ * and if it is non-NULL, increment rdev->nr_pending before dropping the RCU
+ * lock.
+ * When .rdev is set to NULL, the nr_pending count checked again and if
+ * it has been incremented, the pointer is put back in .rdev.
+ */
+
struct disk_info {
struct md_rdev *rdev, *replacement;
struct page *extra_page; /* extra page to use in prexor */