* [PATCH 1/2] md-cluster: update comments for MD_CLUSTER_SEND_LOCKED_ALREADY
@ 2015-12-04 18:32 Guoqing Jiang
2015-12-04 18:32 ` [PATCH 2/2] md: update comment for md_allow_write Guoqing Jiang
2015-12-08 21:17 ` [PATCH 1/2] md-cluster: update comments for MD_CLUSTER_SEND_LOCKED_ALREADY NeilBrown
0 siblings, 2 replies; 4+ messages in thread
From: Guoqing Jiang @ 2015-12-04 18:32 UTC (permalink / raw)
To: gqjiang, neilb; +Cc: linux-raid, rgoldwyn
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>
---
drivers/md/md-cluster.c | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluster.c
index ad3ec7d..0ded8e9 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);
}
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] md: update comment for md_allow_write
2015-12-04 18:32 [PATCH 1/2] md-cluster: update comments for MD_CLUSTER_SEND_LOCKED_ALREADY Guoqing Jiang
@ 2015-12-04 18:32 ` Guoqing Jiang
2015-12-08 21:17 ` NeilBrown
2015-12-08 21:17 ` [PATCH 1/2] md-cluster: update comments for MD_CLUSTER_SEND_LOCKED_ALREADY NeilBrown
1 sibling, 1 reply; 4+ messages in thread
From: Guoqing Jiang @ 2015-12-04 18:32 UTC (permalink / raw)
To: gqjiang, neilb; +Cc: linux-raid, rgoldwyn
MD_CHANGE_CLEAN had been replaced with MD_CHANGE_PENDING after
commit 070dc6 ("md: resolve confusion of MD_CHANGE_CLEAN"),
so make the change accordingly.
Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
---
drivers/md/md.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 5ee18a0..0feff1c 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -7701,7 +7701,7 @@ EXPORT_SYMBOL(md_write_end);
* attempting a GFP_KERNEL allocation while holding the mddev lock.
* Must be called with mddev_lock held.
*
- * In the ->external case MD_CHANGE_CLEAN can not be cleared until mddev->lock
+ * In the ->external case MD_CHANGE_PENDING can not be cleared until mddev->lock
* is dropped, so return -EAGAIN after notifying userspace.
*/
int md_allow_write(struct mddev *mddev)
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] md-cluster: update comments for MD_CLUSTER_SEND_LOCKED_ALREADY
2015-12-04 18:32 [PATCH 1/2] md-cluster: update comments for MD_CLUSTER_SEND_LOCKED_ALREADY Guoqing Jiang
2015-12-04 18:32 ` [PATCH 2/2] md: update comment for md_allow_write Guoqing Jiang
@ 2015-12-08 21:17 ` NeilBrown
1 sibling, 0 replies; 4+ messages in thread
From: NeilBrown @ 2015-12-08 21:17 UTC (permalink / raw)
To: Guoqing Jiang; +Cc: linux-raid, rgoldwyn
[-- Attachment #1: Type: text/plain, Size: 2278 bytes --]
On Sat, Dec 05 2015, Guoqing Jiang wrote:
> 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>
Applied, thanks.
NeilBrown
> ---
> drivers/md/md-cluster.c | 23 ++++++++++++++++++-----
> 1 file changed, 18 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluster.c
> index ad3ec7d..0ded8e9 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);
> }
> --
> 2.1.4
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] md: update comment for md_allow_write
2015-12-04 18:32 ` [PATCH 2/2] md: update comment for md_allow_write Guoqing Jiang
@ 2015-12-08 21:17 ` NeilBrown
0 siblings, 0 replies; 4+ messages in thread
From: NeilBrown @ 2015-12-08 21:17 UTC (permalink / raw)
To: Guoqing Jiang; +Cc: linux-raid, rgoldwyn
[-- Attachment #1: Type: text/plain, Size: 991 bytes --]
On Sat, Dec 05 2015, Guoqing Jiang wrote:
> MD_CHANGE_CLEAN had been replaced with MD_CHANGE_PENDING after
> commit 070dc6 ("md: resolve confusion of MD_CHANGE_CLEAN"),
> so make the change accordingly.
>
> Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
> ---
> drivers/md/md.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index 5ee18a0..0feff1c 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -7701,7 +7701,7 @@ EXPORT_SYMBOL(md_write_end);
> * attempting a GFP_KERNEL allocation while holding the mddev lock.
> * Must be called with mddev_lock held.
> *
> - * In the ->external case MD_CHANGE_CLEAN can not be cleared until mddev->lock
> + * In the ->external case MD_CHANGE_PENDING can not be cleared until mddev->lock
> * is dropped, so return -EAGAIN after notifying userspace.
> */
> int md_allow_write(struct mddev *mddev)
> --
> 2.1.4
Applied, thanks.
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-12-08 21:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-04 18:32 [PATCH 1/2] md-cluster: update comments for MD_CLUSTER_SEND_LOCKED_ALREADY Guoqing Jiang
2015-12-04 18:32 ` [PATCH 2/2] md: update comment for md_allow_write Guoqing Jiang
2015-12-08 21:17 ` NeilBrown
2015-12-08 21:17 ` [PATCH 1/2] md-cluster: update comments for MD_CLUSTER_SEND_LOCKED_ALREADY NeilBrown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).