Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp500107imn; Wed, 27 Jul 2022 11:58:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s5pWWWKZAOPtV7zDLu2e2dLJttvrKa1Mbp0Pt2jRFllxEeLROCySOuzBZ6eILdCdJ0Gjyr X-Received: by 2002:a05:6402:3313:b0:43c:e022:875e with SMTP id e19-20020a056402331300b0043ce022875emr271665eda.327.1658948286981; Wed, 27 Jul 2022 11:58:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658948286; cv=none; d=google.com; s=arc-20160816; b=tCAkZYrwtMnxRMZXK2JJp5RDMFumPMKE95V7K9C/Zucdq5KBhATUlLMW/COnRHkhaE sVYqVOvQAoVzUNRQYotXXxtjIOcjyLntC/WZw76JRWU8XaZ5IBo6pcZhgEN7kioaBuPL IjKGtR6zoDE9fCcF9FTMby9KdaLJWZK0Q8FsyLnj+WXQaBxTHOO0KsNTL0jzNDhxzzgu /aAa/hfa91g7ikuqGxhjEGhNCEnOKte1h/kHNX7LmotEqUxiGxKmUPn4OuOQ2WDYVlEp /uO+BuSq6jWlpTeDRqxBp16kNl8yrJDQsOhhd7Fb0xcQZQ53raq0I/4KNGJqi/Yrv9y1 60Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FvrcKnor3FIgbxl/CRbAB5cVx95trNXxgvIg0PqK0ow=; b=T3A0HFOpzFU+2CUP+gzFWh8rI0HwvyfSdPhLVADRLNVofMuX7Gy+dYmxZ+RhBuk0gM GoT+s90nGJ201TabsNYR2J59XX8mlenfrpkFJAc9iiBhhq/8Trh91lhAHFCJNqtuZQLY jimeSbV0oSB+xwtfWbwbvkCrnHo3HbNX8b2YBw54TfLp3tv5OMPKJQIY9sTc/o1OgxDu zPY40gzLlpUdM3yhsMq8P8faM1xhrkv9R4xKKYFI2N8czp2rTe+uM4rL8N6ZxFJGaxM5 aU5R1mXUSTWa3SJgWjmXgAq0Mya0Xpfb9MZUPhifeF/5uAqs1ZlFrgSH+UtDB94H7Pnx 8Y/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xmn7M5kb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fg3-20020a056402548300b0043cc4d599f8si1454769edb.161.2022.07.27.11.57.41; Wed, 27 Jul 2022 11:58:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xmn7M5kb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238278AbiG0Qft (ORCPT + 99 others); Wed, 27 Jul 2022 12:35:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235592AbiG0QeH (ORCPT ); Wed, 27 Jul 2022 12:34:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9EAA550A6; Wed, 27 Jul 2022 09:26:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C7601B821BC; Wed, 27 Jul 2022 16:26:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2CD06C433D6; Wed, 27 Jul 2022 16:26:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658939184; bh=ha1Tvj/TwkZrbyOljA7y31mT43yEh3Mf6mEIHFW84/4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xmn7M5kb635d1FiVj7V6zNBj23ZJwYW/BmDzTJUgMMwImpoDfJkYDGR/NPASK06iy afF83amQ6Zw4ImvBo5cRyc/p97ElokprUc+ksPE+YIguB4XLBanVxBtoj8qztv3tyM TxJX79MYgp0R8rny/L5TbZ6M6sLC5dayfD512PAc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexander Aring , David Teigland , Sasha Levin Subject: [PATCH 4.19 42/62] dlm: fix pending remove if msg allocation fails Date: Wed, 27 Jul 2022 18:10:51 +0200 Message-Id: <20220727161005.821253678@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220727161004.175638564@linuxfoundation.org> References: <20220727161004.175638564@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexander Aring [ Upstream commit ba58995909b5098ca4003af65b0ccd5a8d13dd25 ] 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 Signed-off-by: David Teigland Signed-off-by: Sasha Levin --- fs/dlm/lock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c index ac53403e9edb..35bfb681bf13 100644 --- a/fs/dlm/lock.c +++ b/fs/dlm/lock.c @@ -4069,13 +4069,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 = 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); -- 2.35.1