summaryrefslogtreecommitdiff
path: root/lib/percpu-refcount.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.com>2017-03-15 14:05:14 +1100
committerShaohua Li <shli@fb.com>2017-03-22 19:18:30 -0700
commit55cc39f345256af241deb6152ff5c06bedd10f11 (patch)
tree9d6958f5b6960b3ba9010aa0d23bbe9c3feb5ff2 /lib/percpu-refcount.c
parent6497709b5d1bccce7de1df678d5f147d614551d1 (diff)
md: close a race with setting mddev->in_sync
If ->in_sync is being set just as md_write_start() is being called, it is possible that set_in_sync() won't see the elevated ->writes_pending, and md_write_start() won't see the set ->in_sync. To close this race, re-test ->writes_pending after setting ->in_sync, and add memory barriers to ensure the increment of ->writes_pending will be seen by the time of this second test, or the new ->in_sync will be seen by md_write_start(). Add a spinlock to array_state_show() to ensure this temporary instability is never visible from userspace. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'lib/percpu-refcount.c')
0 files changed, 0 insertions, 0 deletions