diff options
author | Wolfram Sang <wsa@the-dreams.de> | 2018-03-24 13:39:18 +0100 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2018-03-24 13:39:18 +0100 |
commit | 0b884c22c5b7f6ef985b3d39fed06ad1f8296042 (patch) | |
tree | 74504e80ad62cb0acabdfa796348d001d5d1a2a4 /drivers/md/raid1.h | |
parent | i2c: pca-platform: drop gpio from platform data (diff) | |
parent | dt-bindings: at24: add Renesas R1EX24128 (diff) | |
download | linux-dev-0b884c22c5b7f6ef985b3d39fed06ad1f8296042.tar.xz linux-dev-0b884c22c5b7f6ef985b3d39fed06ad1f8296042.zip |
Merge tag 'at24-4.17-updates-for-wolfram' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into i2c/for-4.17
"three new special cases for device tree compatible strings"
Diffstat (limited to 'drivers/md/raid1.h')
-rw-r--r-- | drivers/md/raid1.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/md/raid1.h b/drivers/md/raid1.h index c7294e7557e0..eb84bc68e2fd 100644 --- a/drivers/md/raid1.h +++ b/drivers/md/raid1.h @@ -26,6 +26,18 @@ #define BARRIER_BUCKETS_NR_BITS (PAGE_SHIFT - ilog2(sizeof(atomic_t))) #define BARRIER_BUCKETS_NR (1<<BARRIER_BUCKETS_NR_BITS) +/* Note: raid1_info.rdev can be set to NULL asynchronously by raid1_remove_disk. + * There are three safe ways to access raid1_info.rdev. + * 1/ when holding mddev->reconfig_mutex + * 2/ when resync/recovery is known to be happening - i.e. in code that is + * called as part of performing resync/recovery. + * 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 raid1_info { struct md_rdev *rdev; sector_t head_position; |