diff options
author | Alexander Aring <aahringo@redhat.com> | 2022-04-06 19:34:16 +0200 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2022-04-06 21:03:09 +0200 |
commit | ba58995909b5098ca4003af65b0ccd5a8d13dd25 (patch) | |
tree | b79ab6eebcb578abeec0e5c86d509ecc44c80c25 /fs/dlm | |
parent | dlm: fix wake_up() calls for pending remove (diff) | |
download | linux-ba58995909b5098ca4003af65b0ccd5a8d13dd25.tar.xz linux-ba58995909b5098ca4003af65b0ccd5a8d13dd25.zip |
dlm: fix pending remove if msg allocation fails
This patch unsets ls_remove_len and ls_remove_name if a message
allocation of a remove messages fails. In this case we never send a
remove message out but set the per ls ls_remove_len ls_remove_name
variable for a pending remove. Unset those variable should indicate
possible waiters in wait_pending_remove() that no pending remove is
going on at this moment.
Cc: stable@vger.kernel.org
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm')
-rw-r--r-- | fs/dlm/lock.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c index 137cf09b51e5..f5330e58d1fc 100644 --- a/fs/dlm/lock.c +++ b/fs/dlm/lock.c @@ -4100,13 +4100,14 @@ static void send_repeat_remove(struct dlm_ls *ls, char *ms_name, int len) rv = _create_message(ls, sizeof(struct dlm_message) + len, dir_nodeid, DLM_MSG_REMOVE, &ms, &mh); if (rv) - return; + goto out; memcpy(ms->m_extra, name, len); ms->m_hash = cpu_to_le32(hash); send_message(mh, ms); +out: spin_lock(&ls->ls_remove_spin); ls->ls_remove_len = 0; memset(ls->ls_remove_name, 0, DLM_RESNAME_MAXLEN); |