From patchwork Tue Sep 19 07:40:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kellermann X-Patchwork-Id: 141796 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp3257786vqi; Tue, 19 Sep 2023 03:03:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHKNj6WNoG/eF6marSilasNUAxjPtu5gyRzGm5yx4lhk0zgzvt3GH9yRJsixM6pwnkomdss X-Received: by 2002:a05:6358:989a:b0:142:d5d4:1b9c with SMTP id q26-20020a056358989a00b00142d5d41b9cmr13728304rwa.26.1695117782131; Tue, 19 Sep 2023 03:03:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695117782; cv=none; d=google.com; s=arc-20160816; b=dLGfDQBkmaA/5dMwgGdw4x2DMiJyZKNIrI9FYA5Qrm6Lz1Kha8EGcM/I7x1uky8iAG 01Eg04j6jCL3v44aM9aol0PN6vVzaDluImB/ZzfoaauLsBN5IGzaixtNwoPIaWoiemj1 GQ5vNf+GQWoA3stVuJbpWvpCh1NClmzLqH2A00n1WqcPYgMRtdnJokHCsULjDAUudKNW cNiV6Z9WRdopHetmv+XX+5n+tAUCmPU8Kv9bxlDR/OLP0P7jWBD37YhT2q5CCYclhZBM sUYXwVgl+EMSjK9t6JG07A5J6Q1pKlwZ2VX/PYhBgjNINAZQg6paCAKSuSQ9W+Wiycio d6Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=zIZLmfcwEqQKatRYsYmTe5x1vkObbB5a/MorlWyMkXw=; fh=ti3iX6InVCNb9hue6GWlfA3tZv8dB/IUjzKiwQDClVI=; b=YEuKhJC0u/ujCL18juRb2cwt6fxiHrEyOcC/VHdb0vB49UP7lg28LCY2yiXBU13JxW X8DBBiJ3hZKduuFvtCLH5Que4sM2y36NwosZcy5beGqlTz9hdu3QJ4Mwue6N348nAqJQ YiP/MUsmusEDFDLTZTpcA/SkO//ogVU8vWIPJunNto8YtFCIGkW1AKuz1NYEPv5c3QJj 0zWffgud3eJgMiRkMMWl0Yfn2gIQnwtUAHttOn9U6LD94dMqtH/5fwofOlpci7HmG3/Z 1/dBo6m3kLgcWz2oic+Fn/LQ3bfJq3bz2HMilXGDA+xR5TAXycavZa7/9ai4oQlkE/fK CVrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=EEa1kexz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id y71-20020a638a4a000000b005697ed9a47csi1504684pgd.29.2023.09.19.03.03.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 03:03:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=EEa1kexz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id C91CF80952EF; Tue, 19 Sep 2023 00:41:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231797AbjISHlD (ORCPT + 26 others); Tue, 19 Sep 2023 03:41:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231808AbjISHlA (ORCPT ); Tue, 19 Sep 2023 03:41:00 -0400 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D339100 for ; Tue, 19 Sep 2023 00:40:54 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2c008d8fd07so31429721fa.1 for ; Tue, 19 Sep 2023 00:40:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1695109252; x=1695714052; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=zIZLmfcwEqQKatRYsYmTe5x1vkObbB5a/MorlWyMkXw=; b=EEa1kexzwJPZWMVHWnEwZf74yHGR0v9QBwYtSi5U865cQSU+6OgAL6BtnRf/bofOfL 6EfdogIh6yE3XSL0QmqPKvmBo6M64Nd47TNr8vajvxlmOU7MTP3lmKqSzmE+B0vTjFTE sYx8uss4Rls6KTTFti9zCLwEXbynKgUAMI8kwyBdpnfhA+bU6uFQ7Q2/7NggQsxaHGWy hJ9g09gAxQ0CHWAUlYKVldwTAZj2UNACQnfnbDlBe6pmVl3f55x0fOLJfe3JHIpYRbDG iL3jcFcF/QrhY7iukXFZKvEWArmCYaP+c65gfxgkWWpWotpa54qsWOlODv6AHxxBCPOx FioA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695109252; x=1695714052; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zIZLmfcwEqQKatRYsYmTe5x1vkObbB5a/MorlWyMkXw=; b=Y7FLlQNIPXYqbB7gHh+Jxjl5BGNhA6IEF0nY61I5sKhGUnTAJ6aCDPRKZuPv0AnTtS iyJnQv1j28ZGf5MVMhvhxD03GeEVmpb9Qr2bX+LvSC61nfwcL08QY3VRu9wUzBCI5sUM vPlxPAOEr1c7iQ0gJx8PxZPj3kG40m+1lLhx7Z2lMoyD+5WlkR23dDEJSqHxzL+BwZ7x Ii23KSOsXDOUyO6nCod7wdFr6FNTLb9+ufZWsvg515XuQtoal/pX5UzkEZC7hTk/niFf TTHmkG/iCUrvYyx1BQTsBCJnC1nW41lRpjN7T6H0n8ciE0JNOC0fE8ghto3lWgIo+42i L6Gg== X-Gm-Message-State: AOJu0YzsBSb/hx6hG5J+Mzy1vIzquTB9vNIkyugucnHDqAj712cxZMyr j7q9B2tVf4jvrKGO8pTGqD0EYw== X-Received: by 2002:a2e:151a:0:b0:2c0:2e1b:5627 with SMTP id s26-20020a2e151a000000b002c02e1b5627mr458469ljd.35.1695109252437; Tue, 19 Sep 2023 00:40:52 -0700 (PDT) Received: from heron.intern.cm-ag (p200300dc6f209c00529a4cfffe3dd983.dip0.t-ipconnect.de. [2003:dc:6f20:9c00:529a:4cff:fe3d:d983]) by smtp.gmail.com with ESMTPSA id fy20-20020a170906b7d400b009ada9f7217asm7441851ejb.88.2023.09.19.00.40.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 00:40:52 -0700 (PDT) From: Max Kellermann To: Alexander Viro , Christian Brauner Cc: Max Kellermann , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] fs/pipe: remove duplicate "offset" initializer Date: Tue, 19 Sep 2023 09:40:44 +0200 Message-Id: <20230919074045.1066796-1-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 19 Sep 2023 00:41:11 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777459823405007193 X-GMAIL-MSGID: 1777459823405007193 This code duplication was introduced by commit a194dfe6e6f6 ("pipe: Rearrange sequence in pipe_write() to preallocate slot"), but since the pipe's mutex is locked, nobody else can modify the value meanwhile. Signed-off-by: Max Kellermann --- fs/pipe.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/pipe.c b/fs/pipe.c index 6c1a9b1db907..139190165a1c 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -537,7 +537,6 @@ pipe_write(struct kiocb *iocb, struct iov_iter *from) break; } ret += copied; - buf->offset = 0; buf->len = copied; if (!iov_iter_count(from))