This is an automated email from the git hooks/post-receive script.
teigland pushed a commit to branch master
in repository sanlock.
The following commit(s) were added to refs/heads/master by this push:
new 0e1ebca sanlock: rem_lockspace EBUSY when orphans exist
0e1ebca is described below
commit 0e1ebca855bccb18e7a0a253bf42edcd572b2438
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Jun 25 15:45:19 2024 -0500
sanlock: rem_lockspace EBUSY when orphans exist
If a lockspace has orphan resources, return -EBUSY for
rem_lockspace rather than starting lockspace removal, but
blocking the completion. This allows the caller to properly
clean up the orphans and then remove the lockspace.
---
src/lockspace.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/lockspace.c b/src/lockspace.c
index da51af0..7e5185d 100644
--- a/src/lockspace.c
+++ b/src/lockspace.c
@@ -1328,6 +1328,17 @@ int rem_lockspace_start(struct sanlk_lockspace *ls, unsigned int *space_id)
goto out;
}
+ if (sp->flags & SP_USED_BY_ORPHANS) {
+ /* lock ordering: spaces_mutex, then resource_mutex (resource_orphan_count) */
+ int orphans = resource_orphan_count(sp->space_name);
+ if (orphans) {
+ log_space(sp, "rem_lockspace ignored for orphan count %d", orphans);
+ pthread_mutex_unlock(&spaces_mutex);
+ rv = -EBUSY;
+ goto out;
+ }
+ }
+
/*
* Removal happens in a round about way:
* - we set external_remove
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.