summaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5.h
diff options
context:
space:
mode:
authorNeilBrown2013-08-27 07:52:13 +0200
committerNeilBrown2013-08-28 08:58:36 +0200
commitc46501b2deaa06efcaaf82917281941f02c6b307 (patch)
treebafe1a096cda8f657074d59cec815b7ae717cd96 /drivers/md/raid5.h
parentraid5: sysfs entry to control worker thread number (diff)
downloadkernel-qcow2-linux-c46501b2deaa06efcaaf82917281941f02c6b307.tar.gz
kernel-qcow2-linux-c46501b2deaa06efcaaf82917281941f02c6b307.tar.xz
kernel-qcow2-linux-c46501b2deaa06efcaaf82917281941f02c6b307.zip
md/raid5: use seqcount to protect access to shape in make_request.
make_request() access various shape parameters (raid_disks, chunk_size etc) which might be changed by raid5_start_reshape(). If the later is called at and awkward time during the form, the wrong stripe_head might be used. So introduce a 'seqcount' and after finding a stripe_head make sure there is no reason to expect that we got the wrong one. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid5.h')
-rw-r--r--drivers/md/raid5.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/raid5.h b/drivers/md/raid5.h
index 105366371fbf..435b12d58165 100644
--- a/drivers/md/raid5.h
+++ b/drivers/md/raid5.h
@@ -400,6 +400,7 @@ struct r5conf {
int prev_chunk_sectors;
int prev_algo;
short generation; /* increments with every reshape */
+ seqcount_t gen_lock; /* lock against generation changes */
unsigned long reshape_checkpoint; /* Time we last updated
* metadata */
long long min_offset_diff; /* minimum difference between