|
|
887953 |
From 1d9151816d9ef915974081d82fd78b59377b6d1a Mon Sep 17 00:00:00 2001
|
|
|
887953 |
From: Mohit Agrawal <moagrawa@redhat.com>
|
|
|
887953 |
Date: Sat, 9 Mar 2019 08:55:44 +0530
|
|
|
887953 |
Subject: [PATCH 535/538] posix: Deletion of block hosting volume throwing
|
|
|
887953 |
error "target is busy"
|
|
|
887953 |
|
|
|
887953 |
Deletion of block hosting volume with heketi-cli few volumes failed to delete
|
|
|
887953 |
with the message "target is busy".After analyzing the root cause we found fd
|
|
|
887953 |
was not closed because janitor thread was killed by posix_fini.To avoid the same before
|
|
|
887953 |
notifying CHILD_DOWN event to parent all fd's should be closed by janitor_thread.
|
|
|
887953 |
|
|
|
887953 |
Note: The patch is applicable only for downstream release, in upstream release
|
|
|
887953 |
we are using different approach to handle janitor_thread
|
|
|
887953 |
|
|
|
887953 |
Change-Id: I8c8482924af1868b4810e708962cd2978c2a40ab
|
|
|
887953 |
BUG: 1669020
|
|
|
887953 |
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
|
|
|
887953 |
Reviewed-on: https://code.engineering.redhat.com/gerrit/164908
|
|
|
887953 |
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
|
|
887953 |
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
|
|
|
887953 |
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
|
|
887953 |
---
|
|
|
887953 |
xlators/storage/posix/src/posix.c | 20 ++++++++++++++++++++
|
|
|
887953 |
1 file changed, 20 insertions(+)
|
|
|
887953 |
|
|
|
887953 |
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
|
|
|
887953 |
index 8a6282d..9efa1f1 100644
|
|
|
887953 |
--- a/xlators/storage/posix/src/posix.c
|
|
|
887953 |
+++ b/xlators/storage/posix/src/posix.c
|
|
|
887953 |
@@ -7115,6 +7115,15 @@ notify (xlator_t *this,
|
|
|
887953 |
...)
|
|
|
887953 |
{
|
|
|
887953 |
xlator_t *victim = data;
|
|
|
887953 |
+ struct posix_private *priv = NULL;
|
|
|
887953 |
+ struct timespec sleep_till = {0,};
|
|
|
887953 |
+
|
|
|
887953 |
+ if (!this)
|
|
|
887953 |
+ return 0;
|
|
|
887953 |
+
|
|
|
887953 |
+ priv = this->private;
|
|
|
887953 |
+ if (!priv)
|
|
|
887953 |
+ return 0;
|
|
|
887953 |
|
|
|
887953 |
switch (event)
|
|
|
887953 |
{
|
|
|
887953 |
@@ -7128,6 +7137,17 @@ notify (xlator_t *this,
|
|
|
887953 |
{
|
|
|
887953 |
if (!victim->cleanup_starting)
|
|
|
887953 |
break;
|
|
|
887953 |
+ pthread_mutex_lock (&priv->janitor_lock);
|
|
|
887953 |
+ {
|
|
|
887953 |
+ while (!list_empty (&priv->janitor_fds)) {
|
|
|
887953 |
+ clock_gettime(CLOCK_REALTIME, &sleep_till);
|
|
|
887953 |
+ sleep_till.tv_sec += 1;
|
|
|
887953 |
+ (void)pthread_cond_timedwait(&priv->janitor_cond, &priv->janitor_lock,
|
|
|
887953 |
+ &sleep_till);
|
|
|
887953 |
+ }
|
|
|
887953 |
+ }
|
|
|
887953 |
+ pthread_mutex_unlock (&priv->janitor_lock);
|
|
|
887953 |
+
|
|
|
887953 |
gf_log(this->name, GF_LOG_INFO, "Sending CHILD_DOWN for brick %s",
|
|
|
887953 |
victim->name);
|
|
|
887953 |
default_notify(this->parents->xlator, GF_EVENT_CHILD_DOWN, data);
|
|
|
887953 |
--
|
|
|
887953 |
1.8.3.1
|
|
|
887953 |
|