diff options
author | Guoqing Jiang <gqjiang@suse.com> | 2015-12-21 10:51:01 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.com> | 2016-01-06 11:39:21 +1100 |
commit | e19508fa4df896b115f5321c21ce7669559b0863 (patch) | |
tree | 1deee55c3bf4081034c4c69558cf33dec302065a /drivers | |
parent | 8b9277c81450de9d8081ff6571ac5986e6c83f49 (diff) | |
download | linux-stable-e19508fa4df896b115f5321c21ce7669559b0863.tar.gz linux-stable-e19508fa4df896b115f5321c21ce7669559b0863.tar.bz2 linux-stable-e19508fa4df896b115f5321c21ce7669559b0863.zip |
md-cluster: update comments for MD_CLUSTER_SEND_LOCKED_ALREADY
1. fix unbalanced parentheses.
2. add more description about that MD_CLUSTER_SEND_LOCKED_ALREADY
will be cleared after set it in add_new_disk.
Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: NeilBrown <neilb@suse.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/md-cluster.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluster.c index ad3ec7df1547..0ded8e97751d 100644 --- a/drivers/md/md-cluster.c +++ b/drivers/md/md-cluster.c @@ -53,11 +53,12 @@ struct resync_info { * accomodate lock and hold. See next comment. */ #define MD_CLUSTER_SEND_LOCK 4 -/* If cluster operations must lock the communication channel, - * so as to perform extra operations (and no other operation - * is allowed on the MD, such as adding a disk. Token needs - * to be locked and held until the operation completes with - * a md_update_sb(), which would eventually release the lock. +/* If cluster operations (such as adding a disk) must lock the + * communication channel, so as to perform extra operations + * (update metadata) and no other operation is allowed on the + * MD. Token needs to be locked and held until the operation + * completes witha md_update_sb(), which would eventually release + * the lock. */ #define MD_CLUSTER_SEND_LOCKED_ALREADY 5 @@ -1021,6 +1022,18 @@ static int add_new_disk(struct mddev *mddev, struct md_rdev *rdev) unlock_comm(cinfo); else { dlm_lock_sync(cinfo->no_new_dev_lockres, DLM_LOCK_CR); + /* Since MD_CHANGE_DEVS will be set in add_bound_rdev which + * will run soon after add_new_disk, the below path will be + * invoked: + * md_wakeup_thread(mddev->thread) + * -> conf->thread (raid1d) + * -> md_check_recovery -> md_update_sb + * -> metadata_update_start/finish + * MD_CLUSTER_SEND_LOCKED_ALREADY will be cleared eventually. + * + * For other failure cases, metadata_update_cancel and + * add_new_disk_cancel also clear below bit as well. + * */ set_bit(MD_CLUSTER_SEND_LOCKED_ALREADY, &cinfo->state); wake_up(&cinfo->wait); } |