Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1013161pxb; Thu, 9 Sep 2021 18:00:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyu2yF+m1Q4GtHM/a0hgtsZRlFuHDWVPl2C+mij+nuS6bUYUuRqStjZ2NgX68yXXmu44CzT X-Received: by 2002:a92:cd8b:: with SMTP id r11mr4535992ilb.136.1631235625504; Thu, 09 Sep 2021 18:00:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631235625; cv=none; d=google.com; s=arc-20160816; b=WAL+R6mM/ppG6ihOh9O/9Vq4rH93x+q2B6+CXFJr/Li01zFwnqGiaHqlEKywaiYKkS 4ro/4/PT7cwWD0Cj021yvY39gvun35YPJBTTFRck9dL+LtdDFQSd0UO2j55srWSEeGGr +iYDTbc9osnTVgqgr/V5XPS0i+kPyabsBiTDgYSND/1r6mb9H0SNgScvxHRHfIexuA39 xta2ig4NaW6+dHnJQ257+rjVA225gUJyigM7fW9Huk1H0nRAsmfXxfIIJeLWA24q8+VL UFd2KnSopyssBy/L5NkWmRW7jsiMqQvDwXHc6n2cDoKVW566thIdVQu8dXdKjOa+X3wI M/mQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=h8WyjPHmk7gLZMKLoR8kCZfwTC/tabwPnlpKkr7zbYE=; b=xuhWYznVZaX5QTmNUySoVlBW1hHouk7mnz8xaTFDlf1Dtdr05/+iCEB76tWxgS6JTE LIfJaHmSM3O1aKpmiRPJLte73dlIK4ugVHlW+W7AZvv5MUNBXm3fmnKd2UZHGI74XmZE HVQ6YbUX7K4rbWMj5FN6kHcz3oy6CYhcry6VlmLdbjykMtYrII02KWZTKhpAS5rToyAI NjJY9n0UrDcQ4kZ23coxtwQobWPdjmrUZX5wY8FCNXeL5yxpH4GTeRmbBlW97AGJ3gWW 6iX26eEJAKR6yP9nMPCySzsALzOvahRBVwBep1BeOQB2nguCSBCZUQnNNVh88YcAuwqq RmxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ck1Bug0k; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h25si3790383ioj.39.2021.09.09.18.00.12; Thu, 09 Sep 2021 18:00:25 -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=@kernel.org header.s=k20201202 header.b=Ck1Bug0k; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244863AbhIJBAL (ORCPT + 99 others); Thu, 9 Sep 2021 21:00:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:48802 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234405AbhIJAXT (ORCPT ); Thu, 9 Sep 2021 20:23:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 742A16103E; Fri, 10 Sep 2021 00:22:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631233329; bh=+B4JkrMS2L78zRsN9xvJXy82LMuqMkITncHyKOAruPw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ck1Bug0kbZTK90FsLwi0rRmQGDkNgYb+7Vhgnc9kjrsuGsPDF/iM4Bge/cVd5QxAx FRp2NzMSDdm2KUAgs/1OpR1H7tv6weLTvuC4J/pNE6OgNXytFgZ47QUU6K8jFqk24l 8ahvnPIXwBUSJ5CB7bPhMCEMoRHsHpHUDQmAz43P/adcA2uWLGqBp/u6lbP+Xa7uhz IdYGIMWbABjh7hUkpYg0NXLrMfA9NWdmKOTnJeQfEqpdf4QfPc0ewJWRELy/ocnt/u IhDxW1c82fFhaEyvy+BQh4vOFDvSl8NLF5GA/2OcRYYst2bee/iqpLhoESIJrEt7EH EKLT3c42dUpkQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Alexander Aring , Bob Peterson , David Teigland , Sasha Levin , cluster-devel@redhat.com Subject: [PATCH AUTOSEL 5.4 19/37] fs: dlm: fix return -EINTR on recovery stopped Date: Thu, 9 Sep 2021 20:21:24 -0400 Message-Id: <20210910002143.175731-19-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210910002143.175731-1-sashal@kernel.org> References: <20210910002143.175731-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexander Aring [ Upstream commit aee742c9928ab4f5f4e0b00f41fb2d2cffae179e ] This patch will return -EINTR instead of 1 if recovery is stopped. In case of ping_members() the return value will be checked if the error is -EINTR for signaling another recovery was triggered and the whole recovery process will come to a clean end to process the next one. Returning 1 will abort the recovery process and can leave the recovery in a broken state. It was reported with the following kernel log message attached and a gfs2 mount stopped working: "dlm: bobvirt1: dlm_recover_members error 1" whereas 1 was returned because of a conversion of "dlm_recovery_stopped()" to an errno was missing which this patch will introduce. While on it all other possible missing errno conversions at other places were added as they are done as in other places. It might be worth to check the error case at this recovery level, because some of the functionality also returns -ENOBUFS and check why recovery ends in a broken state. However this will fix the issue if another recovery was triggered at some points of recovery handling. Reported-by: Bob Peterson Signed-off-by: Alexander Aring Signed-off-by: David Teigland Signed-off-by: Sasha Levin --- fs/dlm/dir.c | 4 +++- fs/dlm/member.c | 4 +++- fs/dlm/recoverd.c | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/fs/dlm/dir.c b/fs/dlm/dir.c index 10c36ae1a8f9..45ebbe602bbf 100644 --- a/fs/dlm/dir.c +++ b/fs/dlm/dir.c @@ -85,8 +85,10 @@ int dlm_recover_directory(struct dlm_ls *ls) for (;;) { int left; error = dlm_recovery_stopped(ls); - if (error) + if (error) { + error = -EINTR; goto out_free; + } error = dlm_rcom_names(ls, memb->nodeid, last_name, last_len); diff --git a/fs/dlm/member.c b/fs/dlm/member.c index 7ad83deb4505..bbb048a03e3e 100644 --- a/fs/dlm/member.c +++ b/fs/dlm/member.c @@ -433,8 +433,10 @@ static int ping_members(struct dlm_ls *ls) list_for_each_entry(memb, &ls->ls_nodes, list) { error = dlm_recovery_stopped(ls); - if (error) + if (error) { + error = -EINTR; break; + } error = dlm_rcom_status(ls, memb->nodeid, 0); if (error) break; diff --git a/fs/dlm/recoverd.c b/fs/dlm/recoverd.c index 85e245392715..97d052cea5a9 100644 --- a/fs/dlm/recoverd.c +++ b/fs/dlm/recoverd.c @@ -125,8 +125,10 @@ static int ls_recover(struct dlm_ls *ls, struct dlm_recover *rv) dlm_recover_waiters_pre(ls); error = dlm_recovery_stopped(ls); - if (error) + if (error) { + error = -EINTR; goto fail; + } if (neg || dlm_no_directory(ls)) { /* -- 2.30.2