From: Alexander Aring <aahringo@redhat.com>
To: teigland@redhat.com
Cc: agruenba@redhat.com, gfs2@lists.linux.dev, aahringo@redhat.com
Subject: [PATCH v6.16-rc7 3/5] dlm: add release recover attribute for leaving event
Date: Wed, 23 Jul 2025 11:21:54 -0400 [thread overview]
Message-ID: <20250723152156.2988833-4-aahringo@redhat.com> (raw)
In-Reply-To: <20250723152156.2988833-1-aahringo@redhat.com>
We add a attribute to the leaving lockspace event to tell the user space
about an option when doing the lockspace release. Later when we
introduce a new release option it can use this feature to set such option.
Signed-off-by: Alexander Aring <aahringo@redhat.com>
---
fs/dlm/lockspace.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c
index be8dbf4822295..6ff666a511c7a 100644
--- a/fs/dlm/lockspace.c
+++ b/fs/dlm/lockspace.c
@@ -186,12 +186,17 @@ static struct kobj_type dlm_ktype = {
static struct kset *dlm_kset;
-static int do_uevent(struct dlm_ls *ls, int in)
+static int do_uevent(struct dlm_ls *ls, int in, unsigned int release_recover)
{
- if (in)
+ char message[512] = {};
+ char *envp[] = { message, NULL };
+
+ if (in) {
kobject_uevent(&ls->ls_kobj, KOBJ_ONLINE);
- else
- kobject_uevent(&ls->ls_kobj, KOBJ_OFFLINE);
+ } else {
+ snprintf(message, 511, "RELEASE_RECOVER=%u", release_recover);
+ kobject_uevent_env(&ls->ls_kobj, KOBJ_OFFLINE, envp);
+ }
log_rinfo(ls, "%s the lockspace group...", in ? "joining" : "leaving");
@@ -575,7 +580,7 @@ static int new_lockspace(const char *name, const char *cluster,
current lockspace members are (via configfs) and then tells the
lockspace to start running (via sysfs) in dlm_ls_start(). */
- error = do_uevent(ls, 1);
+ error = do_uevent(ls, 1, 0);
if (error < 0)
goto out_recoverd;
@@ -592,7 +597,7 @@ static int new_lockspace(const char *name, const char *cluster,
return 0;
out_members:
- do_uevent(ls, 0);
+ do_uevent(ls, 0, 0);
dlm_clear_members(ls);
kfree(ls->ls_node_array);
out_recoverd:
@@ -733,7 +738,7 @@ static int release_lockspace(struct dlm_ls *ls, int release_option)
if (release_option != DLM_RELEASE_NO_EVENT &&
dlm_user_daemon_available())
- do_uevent(ls, 0);
+ do_uevent(ls, 0, 0);
dlm_recoverd_stop(ls);
--
2.43.0
next prev parent reply other threads:[~2025-07-23 15:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-23 15:21 [PATCH v6.16-rc7 0/5] dlm: dlm lockspace release option updates Alexander Aring
2025-07-23 15:21 ` [PATCH v6.16-rc7 1/5] dlm: check on unequal 3 to allow more values Alexander Aring
2025-07-23 15:21 ` [PATCH v6.16-rc7 2/5] dlm: introduce release parameter defines Alexander Aring
2025-07-23 15:21 ` Alexander Aring [this message]
2025-07-23 15:21 ` [PATCH v6.16-rc7 4/5] dlm: add lockspace member configfs release_recover Alexander Aring
2025-07-23 15:21 ` [PATCH v6.16-rc7 5/5] dlm: introduce DLM_RELEASE_RECOVER Alexander Aring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250723152156.2988833-4-aahringo@redhat.com \
--to=aahringo@redhat.com \
--cc=agruenba@redhat.com \
--cc=gfs2@lists.linux.dev \
--cc=teigland@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox