Received: by 10.223.185.116 with SMTP id b49csp732084wrg; Wed, 21 Feb 2018 06:06:23 -0800 (PST) X-Google-Smtp-Source: AH8x224/ZW4RTlWMfC8veJq1SczrtbYT/qCPbQK0TRYBcN8F0Cg6dTzFu1OtbiPkDbtkfG0xxRFq X-Received: by 10.101.93.17 with SMTP id e17mr2823507pgr.281.1519221983424; Wed, 21 Feb 2018 06:06:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519221983; cv=none; d=google.com; s=arc-20160816; b=mtABX2AtoGX0EcvLudy8UbOUT3rPYaflR3gB/JZEIleAAuxisI4ddXpVUX05ZJPIRX IDfR5oDBP1KWeWN/vpZJx2Xvfc/WEzYmajMsnqf7tMX+CkDeq6MzMSNXm9na6te4LFmq Y3HACff5f0Yluj845tvzpEcQSVTz0eVwM7kcCnk+56Fou2JzY1C7d3ekugLErO45fSos kaoxK+Meldexg/+llpKl8cNr2Cy3Z11310cf0C18f6tQft/s3vJtsOIhITB8vg+rlgY3 NKBCJhGrt7Uf0hOLnYYAOHqo7KiDtb3L/f4d3m47T00NkVBTW1uYkhhxEoli08B2kMCS eKMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=u40FOINwXRLKCPj9Rd7fSZskqCGwuuxQOt2p9jGzVaI=; b=sPIjTMItkMTi6/+n1gVDfmo12XhInho+y6mmVj4HUPUJ0D9leBuWMFwMhvu58lYVGv f58X6vz8m6fNCh1j7oFEolyp5uBMQSE4CZfthhA/h50lkyMRIYMa2GDUR+dVqxPeuDK4 /GZVKPiKLGv7v/f5YJuZELhj/18inkLuNjmlcwc1X4wG0SNhEH9/zn3UI7CtAq50kkhD 0zxludF8AisCi0FpusQF8Fc859zqUTvkZXcqdLNLPU5J1K+Wfvq24ZD2d1VwIby5svHV +0AhgA3D8RebsoxH9qRXNbQqZbioD82vtsB4EUT4whPc/1J84xkbf9/Fv0K4iF6nwvE6 HStg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si7552535pfd.84.2018.02.21.06.06.08; Wed, 21 Feb 2018 06:06:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964976AbeBUN7d (ORCPT + 99 others); Wed, 21 Feb 2018 08:59:33 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:39664 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933118AbeBUNDr (ORCPT ); Wed, 21 Feb 2018 08:03:47 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id AECBB1099; Wed, 21 Feb 2018 13:03:46 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mike Christie , Florian Westphal , Nicholas Bellinger Subject: [PATCH 4.14 132/167] iscsi-target: make sure to wake up sleeping login worker Date: Wed, 21 Feb 2018 13:49:03 +0100 Message-Id: <20180221124531.859644775@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180221124524.639039577@linuxfoundation.org> References: <20180221124524.639039577@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Florian Westphal commit 1c130ae00b769a2e2df41bad3d6051ee8234b636 upstream. Mike Christie reports: Starting in 4.14 iscsi logins will fail around 50% of the time. Problem appears to be that iscsi_target_sk_data_ready() callback may return without doing anything in case it finds the login work queue is still blocked in sock_recvmsg(). Nicholas Bellinger says: It would indicate users providing their own ->sk_data_ready() callback must be responsible for waking up a kthread context blocked on sock_recvmsg(..., MSG_WAITALL), when a second ->sk_data_ready() is received before the first sock_recvmsg(..., MSG_WAITALL) completes. So, do this and invoke the original data_ready() callback -- in case of tcp sockets this takes care of waking the thread. Disclaimer: I do not understand why this problem did not show up before tcp prequeue removal. (Drop WARN_ON usage - nab) Reported-by: Mike Christie Bisected-by: Mike Christie Tested-by: Mike Christie Diagnosed-by: Nicholas Bellinger Fixes: e7942d0633c4 ("tcp: remove prequeue support") Signed-off-by: Florian Westphal Cc: stable@vger.kernel.org # 4.14+ Signed-off-by: Nicholas Bellinger Signed-off-by: Greg Kroah-Hartman --- drivers/target/iscsi/iscsi_target_nego.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/target/iscsi/iscsi_target_nego.c +++ b/drivers/target/iscsi/iscsi_target_nego.c @@ -432,6 +432,9 @@ static void iscsi_target_sk_data_ready(s if (test_and_set_bit(LOGIN_FLAGS_READ_ACTIVE, &conn->login_flags)) { write_unlock_bh(&sk->sk_callback_lock); pr_debug("Got LOGIN_FLAGS_READ_ACTIVE=1, conn: %p >>>>\n", conn); + if (iscsi_target_sk_data_ready == conn->orig_data_ready) + return; + conn->orig_data_ready(sk); return; }