Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1630920rdb; Tue, 20 Feb 2024 02:02:47 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUgSSnoFbcAmEFfo49Z583CgQ4lrSoLEFz8B+EJWxxMBH6QLNPd6mEwWHUSU4svDgj6He8DYYO19GzIN5nkq9ufMO+J5Lfe1N7dWeIXZw== X-Google-Smtp-Source: AGHT+IFOIIoqKv8hXBbpe6PJ08Ix1QaAirRiX66c/Hyo3ldavUKpqQGB20HGYjU0CoFxDjZSCi0e X-Received: by 2002:aa7:d74c:0:b0:564:20f5:6926 with SMTP id a12-20020aa7d74c000000b0056420f56926mr5867180eds.14.1708423367435; Tue, 20 Feb 2024 02:02:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708423367; cv=pass; d=google.com; s=arc-20160816; b=WM6mc5ifsm52b6VxtaLY6iQ4m1fdV8zR2Q5LJKCwBPYrs6eEtzZmUPEIFOQGJIoh6d //TDAQSdbpBjba4qXV3MeePOOlJ9YPvt25YHVJMvmJ3LVFjg59nN4ES/uHFQL9WBKa37 +VT+lvrn+8GZzpWwJfyaIPGT+i2KVc5sbghHUHZgM2t0ZZU8XP/Kb9EUQgC/4KJA6e8q wOpMYwcVl4sEiZ/q68DCUE5BFvtj045llQf3FS7T1qE7kAbM/RDGqsvZ15aH2VW/V2e8 8xbk1n1q4FKrqXo6g+gd6eSCX+MFuPT9LNvX3/KZEaWuvMrpZiHqxo+4TEDvXWBwtIwQ zWMw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=zr6c7sSIbfvqzHD23Oxq7ukZ6RGoKNidU5o+etrjIgs=; fh=hTpkY1Mgf4DefIVGEAnF42s+JGgS4qzFTN0sD/AOzJU=; b=uBdcNevpDKv1ODqcvsyGUpknERQFQRh/WVmxAVVwa28biybNFpRDFQvI+bTJ720E8Q 2/uDjEalVoxDbOHgZ+Ux/y8RReR/M1cKd4fWHOsyImdJSTOZmYtqYC2sw49Hh4dmwXn7 vglQhEhdsUxAit1/b/iofTw47K2xtlgI+Fq6s9m+Jgz2yE2wk3CbCpif4wz1JDH0Li+m MXFDff/II7UVQeBWHa3fomCCbaA5gJn8T3lpOEBUSJwiSa/WZkIcq8wxTGHkG/+ELiOy 6j8hGWcr953GT2+zzLQHv69r68MZ2VqC4V0xzkd16sjeac0go7tLM2RYQk2FaVbU785K L9Xw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="HdGmA/T8"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-72746-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72746-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id t9-20020a056402524900b005646cb3ea6csi1964196edd.393.2024.02.20.02.02.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 02:02:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72746-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="HdGmA/T8"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-72746-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72746-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E183D1F27C42 for ; Tue, 20 Feb 2024 09:53:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D74B463099; Tue, 20 Feb 2024 09:51:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HdGmA/T8" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E0DF66168D; Tue, 20 Feb 2024 09:51:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708422693; cv=none; b=QUqvfM8XEmLxNGErxZCGJhs2pSPgJtRjqf2g1wKSrrMUjdWPH4MNmYIPjmOxy+m0rg/6oPcfR6cOZTVwQWdHOIYG4L19x81ark7KS/NRSLOd1zBx6Jeckt6UocBzP6m6xdA/YBGMvJDerIJkcK3DOcTAPF6JaXR7rcaISdOePCE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708422693; c=relaxed/simple; bh=TPGKN24CaFtGRIE0VeP5mwAzn+ZOxDeAL3aTzRUirss=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FErqkJetXFh+M/h1XCdH+ftOQKwZ47nKLsA1TszeJ3lrI55+/ZybXEZIum3repOOiyiIR7XMJ8beCe6Tf/IO5nbU6Zl0137JULHwtTz8+qlRrFtPDvVYQ1Ao//HAYWXTHi9pXLeXm7VFPeOZbSpfUSniDolafooP7qotdAkkzIg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HdGmA/T8; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C02F3C433F1; Tue, 20 Feb 2024 09:51:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708422692; bh=TPGKN24CaFtGRIE0VeP5mwAzn+ZOxDeAL3aTzRUirss=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HdGmA/T8Yh36xJUAh9kQ4QRKg7xEAQSuwUEa0iQfBV+TmOCP9i2ysDi55lCEigAVt iMT8PDu6Rsb3s5qii2+KygzOb/oCQ9TYhW7beSNZoJsCyQepfzdtxrVNl6qdJpDfM9 ENot3D+ATZi+xZnx9fTxI67SE5FeCahLHb/4spD+As4ZJA9cprBz+57uYMwVLGHLxo dUoQEOj3B16cNb7kuh8ze8i6nhjOtYUO6nOlEpyjUfRbKUX24e7uigjhU/IF3uPzzV 3e6/jprnSqfIlqBk7V1r9K0s6hbEbuvieS7jIy8VvBS7T/S/8Pa9u5ZtLGfGibQ3us f9XfJxph4bz1g== Date: Tue, 20 Feb 2024 10:51:26 +0100 From: Christian Brauner To: Linux regressions mailing list Cc: David Howells , Christian Brauner , Eric Van Hensbergen , Dominique Martinet , Jeff Layton , Matthew Wilcox , netfs@lists.linux.dev, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux_oss@crudebyte.com Subject: Re: [PATCH 2/2] netfs: Fix missing zero-length check in unbuffered write Message-ID: <20240220-autoteile-enthoben-a9a16739b2b9@brauner> References: <20240129094924.1221977-1-dhowells@redhat.com> <20240129094924.1221977-3-dhowells@redhat.com> <960e015a-ec2e-42c2-bd9e-4aa47ab4ef2a@leemhuis.info> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <960e015a-ec2e-42c2-bd9e-4aa47ab4ef2a@leemhuis.info> On Mon, Feb 19, 2024 at 09:38:33AM +0100, Linux regression tracking (Thorsten Leemhuis) wrote: > On 29.01.24 10:49, David Howells wrote: > > Fix netfs_unbuffered_write_iter() to return immediately if > > generic_write_checks() returns 0, indicating there's nothing to write. > > Note that netfs_file_write_iter() already does this. > > > > Also, whilst we're at it, put in checks for the size being zero before we > > even take the locks. Note that generic_write_checks() can still reduce the > > size to zero, so we still need that check. > > > > Without this, a warning similar to the following is logged to dmesg: > > > > netfs: Zero-sized write [R=1b6da] > > > > and the syscall fails with EIO, e.g.: > > > > /sbin/ldconfig.real: Writing of cache extension data failed: Input/output error > > > > This can be reproduced on 9p by: > > > > xfs_io -f -c 'pwrite 0 0' /xfstest.test/foo > > > > Fixes: 153a9961b551 ("netfs: Implement unbuffered/DIO write support") > > Reported-by: Eric Van Hensbergen > > Link: https://lore.kernel.org/r/ZbQUU6QKmIftKsmo@FV7GG9FTHL/ > > David, thx for fixing Eric's regression, which I'm tracking. > > Christian, just wondering: that patch afaics is sitting in vfs.netfs for > about three weeks now -- is that intentional or did it maybe fell > through the cracks somehow? I've moved it to vfs.fixes now and will send later this week. Thanks for the reminder!