Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp214318pxj; Tue, 18 May 2021 01:28:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkDclvRYSN9RQROduV45YYoPW7vrMiTRbJr4sOLf7zLXMXt6Y60SQx88spwdAhPiMPD+f+ X-Received: by 2002:a02:b718:: with SMTP id g24mr4407211jam.16.1621326516337; Tue, 18 May 2021 01:28:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621326516; cv=none; d=google.com; s=arc-20160816; b=yUmH9BI4AW/hYVkO9fV+RV/07b3eN6R02+xkehErJiRg+CoQau3fOndOYcC2DOttd0 TB/DnnQb4j9O7itxZudB2VtyjIjiRgCTblUHXulCL4A7h6HoWg+whLsfnXRrn1t8SiJE 9TTyrwI6YDo39I8iugwX9KIjrUba4NYUiaFB9tDnt1lsXvSTVE5Jkg63QX2EUuHjiQuE td7HCPrFlJk5GeZMCfTfGyhjeS+9TB6vc8B3mJUhWBrEagsPze0VAjqtZ81ukkmqP8v9 X9HzGZpCPEFBrCjcyxkhpYfAzeDKooey8RoDjK9+zhOuyFUNVz3IliJ6T1E1MvCJgJk0 QSkw== 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=EraicwjpKVlXwenQE7kdGxfBDOA1kNbOfRq/wS0wanI=; b=K2IsDToJiyt6XV2WIuNsWhmfxwNJaGLbXc06lK/3J46Iua/zBBAEkdbA3NSuUD3Y2P /u+5Lo4f5YwtL3XHrahLfrD5pl/1yvtpepvaQXukIvIv7IUVx9GRS0G4OOaeVPaqgvx5 S+gN/BkwTi2gLOFj13UEbFwz2v8S/aJooUa7dxZhteKjyz07qZRtF/rix6rZEm8AFFy2 uKoYg1R5IrCQ5R+dV4bbTc162OnnHMMwOGUvf7AqL5r+ogkcoq3bY6olDD/4ttnYdEXu XiFyO+/2M7kdfZy83PzTirc9wX+KPO4/rpu5yZgATlrDHkLqeOTSV4MKdUY24vcKbLg6 mNBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ct3oLnkb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n8si20649407jam.34.2021.05.18.01.28.22; Tue, 18 May 2021 01:28:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ct3oLnkb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S240875AbhEQPAV (ORCPT + 99 others); Mon, 17 May 2021 11:00:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:39052 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241249AbhEQOua (ORCPT ); Mon, 17 May 2021 10:50:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9D5A561464; Mon, 17 May 2021 14:23:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621261390; bh=GTG8bbh8V6Po43xFaE8EyHLkS4c8grvCURbwrR39XoI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ct3oLnkbnKFRie6KGjlVF3zeB12Qv68WPNfFXuQGjedSOZO9MpfyeZmEp3INNNAuP Sez4zU6Kz/TnTSL1vJuAAcD+WHEwMMoliYZvM/4gP89qIE5Q5oScTh1GoQtW1PIEGM TwnlQqb6ZeynocvRw3lLKHv3JOIv1f+fz7plNCAw= 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 5.10 015/289] fs: dlm: flush swork on shutdown Date: Mon, 17 May 2021 15:59:00 +0200 Message-Id: <20210517140305.689779548@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexander Aring [ Upstream commit eec054b5a7cfe6d1f1598a323b05771ee99857b5 ] This patch fixes the flushing of send work before shutdown. The function cancel_work_sync() is not the right workqueue functionality to use here as it would cancel the work if the work queues itself. In cases of EAGAIN in send() for dlm message we need to be sure that everything is send out before. The function flush_work() will ensure that every send work is be done inclusive in EAGAIN cases. Signed-off-by: Alexander Aring Signed-off-by: David Teigland Signed-off-by: Sasha Levin --- fs/dlm/lowcomms.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index 79f56f16bc2c..44e2716ac158 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c @@ -612,10 +612,7 @@ static void shutdown_connection(struct connection *con) { int ret; - if (cancel_work_sync(&con->swork)) { - log_print("canceled swork for node %d", con->nodeid); - clear_bit(CF_WRITE_PENDING, &con->flags); - } + flush_work(&con->swork); mutex_lock(&con->sock_mutex); /* nothing to shutdown */ -- 2.30.2