diff options
author | NeilBrown <neilb@suse.de> | 2014-12-15 02:56:58 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2015-02-03 22:35:53 +0100 |
commit | 36d091f4759d194c99f0705d412afe208622b45a (patch) | |
tree | f76abdd702316a37df60f6522adb3f6a3b230741 /drivers/md/md.h | |
parent | md: level_store: group all important changes into one place. (diff) | |
download | linux-36d091f4759d194c99f0705d412afe208622b45a.tar.xz linux-36d091f4759d194c99f0705d412afe208622b45a.zip |
md: protect ->pers changes with mddev->lock
->pers is already protected by ->reconfig_mutex, and
cannot possibly change when there are threads running or
outstanding IO.
However there are some places where we access ->pers
not in a thread or IO context, and where ->reconfig_mutex
is unnecessarily heavy-weight: level_show and md_seq_show().
So protect all changes, and those accesses, with ->lock.
This is a step toward taking those accesses out from under
reconfig_mutex.
[Fixed missing "mddev->pers" -> "pers" conversion, thanks to
Dan Carpenter <dan.carpenter@oracle.com>]
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.h')
-rw-r--r-- | drivers/md/md.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h index 37e7c17e56a6..e41559dccdc9 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h @@ -391,6 +391,7 @@ struct mddev { * rdev superblocks, events * clearing MD_CHANGE_* * in_sync - and related safemode and MD_CHANGE changes + * pers (also protected by reconfig_mutex and pending IO). */ spinlock_t lock; wait_queue_head_t sb_wait; /* for waiting on superblock updates */ |