From patchwork Sat Feb 2 03:01:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 10794057 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BA49717E9 for ; Sat, 2 Feb 2019 03:01:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD63733028 for ; Sat, 2 Feb 2019 03:01:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A0F9B33032; Sat, 2 Feb 2019 03:01:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC48733028 for ; Sat, 2 Feb 2019 03:01:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726616AbfBBDB2 (ORCPT ); Fri, 1 Feb 2019 22:01:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45450 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726190AbfBBDB2 (ORCPT ); Fri, 1 Feb 2019 22:01:28 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AC302C7C23; Sat, 2 Feb 2019 03:01:27 +0000 (UTC) Received: from rh2.redhat.com (ovpn-122-9.rdu2.redhat.com [10.10.122.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9142860C55; Sat, 2 Feb 2019 03:01:26 +0000 (UTC) From: Mike Christie To: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, nab@linux-iscsi.org, cavery@redhat.com, xiubli@redhat.com Cc: Mike Christie Subject: [PATCH] tcmu: wait for nl reply only if there are listeners Date: Fri, 1 Feb 2019 21:01:21 -0600 Message-Id: <1549076481-15420-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Sat, 02 Feb 2019 03:01:27 +0000 (UTC) Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP genlmsg_multicast_allns used to return -ESRCH even if the message was successfully sent to a listener. With commit: commit cb9f7a9a5c96a773bbc9c70660dc600cfff82f82 Author: Nicolas Dichtel Date: Tue Feb 6 14:48:32 2018 +0100 netlink: ensure to loop over all netns in genlmsg_multicast_allns() it now will return success if the message was sent to a listener. With that patch, tcmu can now immediately fail if -ESRCH is returned because we know there will be no reply. Signed-off-by: Mike Christie --- drivers/target/target_core_user.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index 5831e0e..dccc13c 100644 --- a/drivers/target/target_core_user.c +++ b/drivers/target/target_core_user.c @@ -1794,9 +1794,6 @@ static int tcmu_netlink_event_send(struct tcmu_dev *udev, ret = genlmsg_multicast_allns(&tcmu_genl_family, skb, 0, TCMU_MCGRP_CONFIG, GFP_KERNEL); - /* We don't care if no one is listening */ - if (ret == -ESRCH) - ret = 0; if (!ret) ret = tcmu_wait_genl_cmd_reply(udev); return ret;