Received: by 10.223.185.116 with SMTP id b49csp1018832wrg; Wed, 21 Feb 2018 10:39:40 -0800 (PST) X-Google-Smtp-Source: AH8x225haFZKY7MGvmSb7GA+3vaey1XCpST5odFh0gE+w+717QqBibV1SJ3MLQc9C2jdnQeEcsav X-Received: by 2002:a17:902:36a:: with SMTP id 97-v6mr4041871pld.365.1519238380851; Wed, 21 Feb 2018 10:39:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519238380; cv=none; d=google.com; s=arc-20160816; b=N1tc8ibHlP74PMMcdyVZSfjFpcnKTZzbHtA/pBtZ+blBujJGdquOrN+oa9Hcy1gmTV 9SIRCQHRxij7DgG3DUJH8X693EPxEI0ZL9zYw6tjQ1b0XVXnq7w/OiDiVvodEEQlHkD5 GhXqCnfjwiDrLVdKbM6kMqJIhr/pJfUP7CywgxHsMkraE0a2EgpQdJ9O6K5vH/7BDAYV 0papiAUgxd/jJQQQsSnn/jTJNGV1Z88ve6dn6EVIZ26PdQx0dfyX39ecKQ99uuT9uAJh PzATsnZQJMrYRmJ6G3VqCXlql13JF6gma9KaHaFtX0nruEi4LWHzdYRWHacQaD5WaGND SV6Q== 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=TZuQIvJJJx9szFGOHZGNWWSSU7MCpfi+nRTFS3+qMYc=; b=dlZVk58JJ/SM/QtFhIzDrB1+EtXruJWYvmQPSQiFW0yoVND+cPl8kmifRSia3k3dg3 RXILyKpKFSq7Pv3RrNLkxxa7r1xR2+WE69W0TP09khz+5pb1JWIbrj0ZF8oDznsgteX9 itROut5sCQZcnffcOwPKuXZlLwDkViT2hoZwIFPT/1lV7S1SH7ikh0AONZWlS+e5dKOM YgGA2H9/tQuT9U2ap/jV2uoejR2J+UqbNgMEDnIbxHm+rvxBKSPDaxeZ3fjMLBCIOYQ0 o4/Q4ay4zNraaaRrjt+Y0bYphiaQrsZW8Ez4MJh7unQNP+okcB1u3WNBalqhSSQ+fkF/ T65w== 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 p1si3061169pgc.593.2018.02.21.10.39.26; Wed, 21 Feb 2018 10:39:40 -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 S965713AbeBUNNT (ORCPT + 99 others); Wed, 21 Feb 2018 08:13:19 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:45972 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753150AbeBUNNN (ORCPT ); Wed, 21 Feb 2018 08:13:13 -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 10A2F1098; Wed, 21 Feb 2018 13:13:12 +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.15 133/163] iscsi-target: make sure to wake up sleeping login worker Date: Wed, 21 Feb 2018 13:49:22 +0100 Message-Id: <20180221124537.534820304@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180221124529.931834518@linuxfoundation.org> References: <20180221124529.931834518@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.15-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; }