Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp570537imw; Wed, 13 Jul 2022 04:09:20 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tKygs0BqrcBfdDGJNj6egn+NmD9BnphItYtK2stmURbs1fs+DPT8hV8YTO5/bJ+cIPRruM X-Received: by 2002:a17:907:2855:b0:72b:700e:21eb with SMTP id el21-20020a170907285500b0072b700e21ebmr2881643ejc.270.1657710560259; Wed, 13 Jul 2022 04:09:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657710560; cv=none; d=google.com; s=arc-20160816; b=t0Q7NiJqRy6l+H70xq8fx0b2Vsme91kYP5cfiS2hlXRUxXZGNVctM7WxvCruNrtGfX KYfDzniB13Zz33IP68DxD3DpotCNq9uAUOfX0POX0bRsZ6zGDoR7ACP4uszALt+rerO3 D1W9/g5z11IhfBZntZFD8thSRSQINCen8ls6+HAGT2BLlfhttVpqac9ws7H7fd3D2xBA bxKM2MiHh2yanC9p1IYbMOtqf5gq7TfVA6jk4vrqKXx/PZlqe47+T1KtoWWfqb1spH5P bSejMeWgr/ByOQ5Y+pjrVViakpLY4WtKJTbFFwOxOvvlronNUS54eFfwfODa91Cf4mtv eFIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from:sender :hmm_source_type:hmm_attache_num:hmm_source_ip; bh=cKQzBR6XBVdRZpJQ4ocX4gVhC9QVrrSeqQr4Dtqc4AY=; b=w0dkI2JO4f2SJuB0gPDnAuoxZrD5PKaFJMkaomJQNsuyaEXZ1rOTk5H4Tj35J/7xXn c20UW9y2fgTiJth8MUeXaud7FQfOmUJBH0l3O+XfyN1wp6H4IwqTx4So1xgmVdCMYBCK hah2u7R8CdpPJa6HszaLQNqBdX8itMdXPdsZqk9be4Jb2+/ZmX9zB/vQBImhFEnMQhQK nYf0oJyAzHifHkLv+U281/v6WxCg3ILBdcxA/cg11h4wi4ULfFCut7WytKTHGPPk1DkD s+YVXKK/AdtYqDkjAfnVAYHBA8RLUGuahChvPlgyv8uWG4W54MtYFn/aA2pI9GpHg0i4 zL/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oy3-20020a170907104300b0070dcedd6ca2si15211565ejb.713.2022.07.13.04.08.53; Wed, 13 Jul 2022 04:09:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235037AbiGMKax (ORCPT + 99 others); Wed, 13 Jul 2022 06:30:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236018AbiGMKau (ORCPT ); Wed, 13 Jul 2022 06:30:50 -0400 X-Greylist: delayed 410 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 13 Jul 2022 03:30:49 PDT Received: from chinatelecom.cn (prt-mail.chinatelecom.cn [42.123.76.223]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 37390FC9A4 for ; Wed, 13 Jul 2022 03:30:49 -0700 (PDT) HMM_SOURCE_IP: 172.18.0.188:55882.729471011 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP Received: from clientip-10.133.8.199 (unknown [172.18.0.188]) by chinatelecom.cn (HERMES) with SMTP id 479A82800C5; Wed, 13 Jul 2022 18:23:55 +0800 (CST) X-189-SAVE-TO-SEND: +liuxp11@chinatelecom.cn Received: from ([172.18.0.188]) by app0023 with ESMTP id 8281e15f9b554ce79754ed296a5cd601 for viro@zeniv.linux.org.uk; Wed, 13 Jul 2022 18:23:57 CST X-Transaction-ID: 8281e15f9b554ce79754ed296a5cd601 X-Real-From: liuxp11@chinatelecom.cn X-Receive-IP: 172.18.0.188 X-MEDUSA-Status: 0 Sender: liuxp11@chinatelecom.cn From: Liu Xinpeng To: viro@zeniv.linux.org.uk Cc: linux-kernel@vger.kernel.org, Liu Xinpeng Subject: [PATCH] iov_iter: Fix repeated minus operation Date: Wed, 13 Jul 2022 18:23:40 +0800 Message-Id: <1657707820-124858-1-git-send-email-liuxp11@chinatelecom.cn> X-Mailer: git-send-email 1.8.3.1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After executing command 'cat /proc/cpuinfo', got a message: [ 6.909745] ------------[ cut here ]------------ [ 6.910267] WARNING: CPU: 0 PID: 76 at lib/iov_iter.c:1026 iov_iter_pipe+0x34/0x40 [ 6.910951] Modules linked in: [ 6.911584] CPU: 0 PID: 76 Comm: cat Not tainted 5.19.0-rc6-next-20220711 #9 [ 6.911916] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014 [ 6.912668] RIP: 0010:iov_iter_pipe+0x34/0x40 [ 6.913062] Code: 72 54 39 72 5c 76 23 48 c7 07 00 00 00 00 48 c7 47 08 00 00 00 00 c6 07 03 48 89 4f 10 48 89 57 18 89 47 20 89 47 24 c3 0f 0b <0f> 7 [ 6.914341] RSP: 0018:ffffc900001c7d48 EFLAGS: 00000246 [ 6.914647] RAX: 0000000000000010 RBX: ffff888004988700 RCX: 0000000000000000 [ 6.914893] RDX: ffff88800490bc00 RSI: 0000000000000010 RDI: ffffc900001c7d58 [ 6.915302] RBP: ffffc900001c7e00 R08: 0000000000000000 R09: ffff888004cafad8 [ 6.915609] R10: 0000000000020000 R11: 0000000000001000 R12: ffff88800490bc00 [ 6.915856] R13: ffffc900001c7e48 R14: 00000000000002d5 R15: ffff88800490bc00 [ 6.916352] FS: 00000000016df8c0(0000) GS:ffff88800f600000(0000) Checking the code, need to delete the duplicate minus in a loop. Signed-off-by: Liu Xinpeng --- lib/iov_iter.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/iov_iter.c b/lib/iov_iter.c index 4a3451e..642841ce 100644 --- a/lib/iov_iter.c +++ b/lib/iov_iter.c @@ -472,7 +472,6 @@ static size_t copy_pipe_to_iter(const void *addr, size_t bytes, break; memcpy_to_page(page, off, addr, chunk); addr += chunk; - n -= chunk; } return bytes; } -- 1.8.3.1