From patchwork Wed Aug 28 21:02:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13781952 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FD38C71143 for ; Wed, 28 Aug 2024 21:03:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8C5F36B0089; Wed, 28 Aug 2024 17:03:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8760C6B008A; Wed, 28 Aug 2024 17:03:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 73DB56B008C; Wed, 28 Aug 2024 17:03:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 4EE886B0089 for ; Wed, 28 Aug 2024 17:03:10 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id F2CA7A9CB0 for ; Wed, 28 Aug 2024 21:03:09 +0000 (UTC) X-FDA: 82502879298.25.13EEF9B Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf19.hostedemail.com (Postfix) with ESMTP id 58BD31A0004 for ; Wed, 28 Aug 2024 21:03:08 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=d9tkoZGy; spf=pass (imf19.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724878901; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=XFobmMcyik8XghRtkh2gK9+MeaxVAEEC6pZ/c4IMu/w=; b=JDOgfsI9x1KLkeg3oD1GVZCJ2MBl+aX4NZZvozYeC/iDA37sU/B0FnJ3CfvHxzngVKdIpV +EHyTLgbFry2mLhhIsBiAd0TMsZfe4UrRxQnpkNbiIR+pdIWcxZFG571OuSg+v8e38FYkO HFvUS+Qcs3Po+GqiLt4E2NHN9wtaO3s= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724878901; a=rsa-sha256; cv=none; b=Mj9IQOjhD9E/i3E58/inbM00myciYiaeMxodOb3djZi9yZL/U4pxUJa1KbQvNxwy/J4jkT BIYJrMm0rQxZ0G9kUdSWtdol/b9L6IGCpurNHy/EwzgjrZsIlcaCht7LDLA83OHdcZy5uC SF8VIBfE/3XLrvUXd/qddxTdbs+g/00= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=d9tkoZGy; spf=pass (imf19.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724878987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=XFobmMcyik8XghRtkh2gK9+MeaxVAEEC6pZ/c4IMu/w=; b=d9tkoZGyXHxS5MHOW6x/8wo4rt2MzLG9QUDWlya2wP8s1ENaSNpvJBK4ASO9WIEGd8Ojai 8O0/2RAjt6WU9QfqRsnlsN+HK4KaVOSlm+h5oLlmlHo/15Dr9ZKp6D4TJBwyNhWNKGsF7e 0u3GsHk3wdOLvhj1gtKmErP+/lAFpmg= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-668-pWU2m7E2O3W_VVpN-j_iRQ-1; Wed, 28 Aug 2024 17:03:04 -0400 X-MC-Unique: pWU2m7E2O3W_VVpN-j_iRQ-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 413511955D47; Wed, 28 Aug 2024 21:03:00 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.30]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8C48D1955BED; Wed, 28 Aug 2024 21:02:53 +0000 (UTC) From: David Howells To: Christian Brauner , Steve French Cc: David Howells , Paulo Alcantara , Tom Talpey , 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 Subject: [PATCH 0/6] mm, netfs, cifs: Miscellaneous fixes Date: Wed, 28 Aug 2024 22:02:41 +0100 Message-ID: <20240828210249.1078637-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Rspamd-Queue-Id: 58BD31A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YEGhP veRvrChoiyk2S5d6sfukUhKJgI7EXyY3mQQempIIo1EOqmEVHZP5EaZ6Nr4uKY4DLYyZKqHroenWK0QLaGxaULNw04CBoxOb6REv+W6WSbQfEUMBo1Kn6BRGTwoAk9j6LihAO44DXbRHUu140c0W/t2TziF+wgIFqCPFsZqtT4RR/Sb5KJ0eZDJGpXLg5fZfM+bN+f1M4OOMEBhU+XaclgOwIFbgh0Yx/vHmlbl6bPxTJUX8HDuWbfJzGNbNljoXvdhwEk0+7xnnwYYabmBerNswYSgUJhehVV+4I3uY0L5QGaoWE84RdpX11QqeB1clqli3qHv24jSkGIW8WvOQ7xMOm5eXfQ27sgCMF2UtY6GkNVgk= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Hi Christian, Steve, Firstly, here are some fixes to DIO read handling and the retrying of reads, particularly in relation to cifs: (1) Fix the missing credit renegotiation in cifs on the retrying of reads. The credits we had ended with the original read (or the last retry) and to perform a new read we need more credits otherwise the server can reject our read with EINVAL. (2) Fix the handling of short DIO reads to avoid ENODATA when the read retry tries to access a portion of the file after the EOF. Secondly, some patches fixing cifs copy and zero offload: (3) Fix cifs_file_copychunk_range() to not try to partially invalidate folios that are only partly covered by the range, but rather flush them back and invalidate them. (4) Fix filemap_invalidate_inode() to use the correct invalidation function so that it doesn't leave partially invalidated folios hanging around (which may hide part of the result of an offloaded copy). (5) Fix smb3_zero_data() to correctly handle zeroing of data that's buffered locally but not yet written back and with the EOF position on the server short of the local EOF position. Note that this will also affect afs and 9p, particularly with regard to direct I/O writes. And finally, here's an adjustment to debugging statements: (6) Adjust three debugging output statements. Not strictly a fix, so could be dropped. Including the subreq ID in some extra debug lines helps a bit, though. The patches can also be found here: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=netfs-fixes Thanks, David David Howells (6): cifs: Fix lack of credit renegotiation on read retry netfs, cifs: Fix handling of short DIO read cifs: Fix copy offload to flush destination region mm: Fix filemap_invalidate_inode() to use invalidate_inode_pages2_range() cifs: Fix FALLOC_FL_ZERO_RANGE to preflush buffered part of target region netfs, cifs: Improve some debugging bits fs/netfs/io.c | 21 +++++++++++++------- fs/smb/client/cifsfs.c | 21 ++++---------------- fs/smb/client/cifsglob.h | 1 + fs/smb/client/file.c | 37 ++++++++++++++++++++++++++++++++---- fs/smb/client/smb2ops.c | 26 +++++++++++++++++++------ fs/smb/client/smb2pdu.c | 41 +++++++++++++++++++++++++--------------- fs/smb/client/trace.h | 1 + include/linux/netfs.h | 1 + mm/filemap.c | 2 +- 9 files changed, 101 insertions(+), 50 deletions(-)