Received: by 10.192.165.148 with SMTP id m20csp529662imm; Wed, 25 Apr 2018 03:45:15 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+GAf8qQ68i3HgFplb4UuidTajN9aeKwZb5PwKaRSrSlOqv9/+bGx19Ur3UlQpeyzzjQsRA X-Received: by 2002:a17:902:780d:: with SMTP id p13-v6mr28871565pll.281.1524653115282; Wed, 25 Apr 2018 03:45:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524653115; cv=none; d=google.com; s=arc-20160816; b=krPRS6tN4PUV6UDR5ogGvlJ76IzB+/99L6+H2BovmMg4ML4ut04oRNj4sgpw55iW6m Gug7GEx7byIeGS+Mf4+aDTGh63sQBXlIR07KLcTnlr2VF1npPvXcL/YUyd4IOnANq+Zg h5GHHVL7HP5N3W0OHtoiwY+a2kEm2M7ryflaVP668CvobnniySmPDbbnGcK5JhN7XCLy wLGeB/3ESSV2ZQRV0VjWN3Bn/npiOP3IsKUTb74s73wNaYG8MyKva4xGZx6fdG4kSOMb 9NBS1D+DOKNPk9iWCo8T/aLvkdyxDA9E9ExMuEZ7RzZOPDiW2j1tvGe/3klIgzEVAlVm HQyA== 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=LgbuWPxBLDn5273THEJ25SVXJyBU/lCOLgoxelGPK7E=; b=ud4KHx7pLq8/IOyPZHbXPjW2CtoMsYzknGzSv/mwGaDoiEGctkSOgCq4ydfDCjvV3u DtlBJAR3/gWYy4kHtFNwcOQNDOeI84OBXmTrHo3yk0TtvOExfTl9Pd4sLMU3uRXg0FZ0 NVMMwF9gvuKN1muLELBAvmCxU6YRtxoGT/sXr2bXszNAl4sIgMGnms38gIw8WtXxvAke xmgdMszMumv9TH6lcLzIuKDpoCaMvv78Rqo0AW1cSeoYdVQehD9rqzzFPabDI2CTr+qG JcgSDtMA0wEAyRxm8PDtRHW6Ho7NrBlEUDxVw/f+KytNBkczitWgv3KvJ/tUstWcdt9q L1VQ== 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 r14si1090177pfh.211.2018.04.25.03.45.00; Wed, 25 Apr 2018 03:45:15 -0700 (PDT) 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 S1754272AbeDYKnw (ORCPT + 99 others); Wed, 25 Apr 2018 06:43:52 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:53116 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751982AbeDYKns (ORCPT ); Wed, 25 Apr 2018 06:43:48 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 4E2C9266; Wed, 25 Apr 2018 10:43:47 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , Trond Myklebust , Sasha Levin Subject: [PATCH 4.14 158/183] SUNRPC: Dont call __UDPX_INC_STATS() from a preemptible context Date: Wed, 25 Apr 2018 12:36:18 +0200 Message-Id: <20180425103248.887978060@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103242.532713678@linuxfoundation.org> References: <20180425103242.532713678@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: Trond Myklebust [ Upstream commit 0afa6b4412988019db14c6bfb8c6cbdf120ca9ad ] Calling __UDPX_INC_STATS() from a preemptible context leads to a warning of the form: BUG: using __this_cpu_add() in preemptible [00000000] code: kworker/u5:0/31 caller is xs_udp_data_receive_workfn+0x194/0x270 CPU: 1 PID: 31 Comm: kworker/u5:0 Not tainted 4.15.0-rc8-00076-g90ea9f1 #2 Workqueue: xprtiod xs_udp_data_receive_workfn Call Trace: dump_stack+0x85/0xc1 check_preemption_disabled+0xce/0xe0 xs_udp_data_receive_workfn+0x194/0x270 process_one_work+0x318/0x620 worker_thread+0x20a/0x390 ? process_one_work+0x620/0x620 kthread+0x120/0x130 ? __kthread_bind_mask+0x60/0x60 ret_from_fork+0x24/0x30 Since we're taking a spinlock in those functions anyway, let's fix the issue by moving the call so that it occurs under the spinlock. Reported-by: kernel test robot Signed-off-by: Trond Myklebust Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- net/sunrpc/xprtsock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -1069,18 +1069,18 @@ static void xs_udp_data_read_skb(struct /* Suck it into the iovec, verify checksum if not done by hw. */ if (csum_partial_copy_to_xdr(&rovr->rq_private_buf, skb)) { - __UDPX_INC_STATS(sk, UDP_MIB_INERRORS); spin_lock(&xprt->recv_lock); + __UDPX_INC_STATS(sk, UDP_MIB_INERRORS); goto out_unpin; } - __UDPX_INC_STATS(sk, UDP_MIB_INDATAGRAMS); spin_lock_bh(&xprt->transport_lock); xprt_adjust_cwnd(xprt, task, copied); spin_unlock_bh(&xprt->transport_lock); spin_lock(&xprt->recv_lock); xprt_complete_rqst(task, copied); + __UDPX_INC_STATS(sk, UDP_MIB_INDATAGRAMS); out_unpin: xprt_unpin_rqst(rovr); out_unlock: