{"id":2229574,"url":"http://patchwork.ozlabs.org/api/1.1/covers/2229574/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-cifs-client/cover/20260428131756.922303-1-dhowells@redhat.com/","project":{"id":12,"url":"http://patchwork.ozlabs.org/api/1.1/projects/12/?format=json","name":"Linux CIFS Client","link_name":"linux-cifs-client","list_id":"linux-cifs.vger.kernel.org","list_email":"linux-cifs@vger.kernel.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260428131756.922303-1-dhowells@redhat.com>","date":"2026-04-28T13:17:30","name":"[v5,00/24] netfs: Miscellaneous fixes","submitter":{"id":59,"url":"http://patchwork.ozlabs.org/api/1.1/people/59/?format=json","name":"David Howells","email":"dhowells@redhat.com"},"mbox":"http://patchwork.ozlabs.org/project/linux-cifs-client/cover/20260428131756.922303-1-dhowells@redhat.com/mbox/","series":[{"id":501852,"url":"http://patchwork.ozlabs.org/api/1.1/series/501852/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=501852","date":"2026-04-28T13:17:35","name":"netfs: Miscellaneous fixes","version":5,"mbox":"http://patchwork.ozlabs.org/series/501852/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/covers/2229574/comments/","headers":{"Return-Path":"\n <linux-cifs+bounces-11190-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-cifs@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=FGrlfbwn;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c09:e001:a7::12fc:5321; helo=sto.lore.kernel.org;\n envelope-from=linux-cifs+bounces-11190-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com\n header.b=\"FGrlfbwn\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=170.10.133.124","smtp.subspace.kernel.org;\n dmarc=pass (p=quarantine dis=none) header.from=redhat.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=redhat.com"],"Received":["from sto.lore.kernel.org (sto.lore.kernel.org\n [IPv6:2600:3c09:e001:a7::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g4hQK6X54z1yHv\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 23:40:25 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sto.lore.kernel.org (Postfix) with ESMTP id 5467A3141C75\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 13:25:07 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id C96B64534B3;\n\tTue, 28 Apr 2026 13:18:50 +0000 (UTC)","from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id CAC2A450902\n\tfor <linux-cifs@vger.kernel.org>; Tue, 28 Apr 2026 13:18:48 +0000 (UTC)","from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-316-QRUePlQQOV-Vk5ir6dmz8g-1; Tue,\n 28 Apr 2026 09:18:42 -0400","from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id AE2DA188263F;\n\tTue, 28 Apr 2026 13:18:02 +0000 (UTC)","from warthog.procyon.org.com (unknown [10.44.32.126])\n\tby mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id 13221180047F;\n\tTue, 28 Apr 2026 13:17:58 +0000 (UTC)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777382330; cv=none;\n b=tMxUw+O8kpRBiLcqcVoAKVisdYN6lNsHGUDhAOxPZA7WCch73ri3XPkc5x64zJeo5Rh01ys1jCLlZTjprAH0y96E+2xIarteaQRnNKr7T4sOtSMiUBFnQhncaao9Sku3QqCkLrWeRyyrtapQkhxZuOrCTp3kRtu8qH2x6GAzqVY=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777382330; c=relaxed/simple;\n\tbh=pPM0SJ1S1cvk3LnQV16ZbOsgL0uWCrEXA3zCN4WXIh4=;\n\th=From:To:Cc:Subject:Date:Message-ID:MIME-Version;\n b=D0d9pXWibIfces/bq2clJBDhrStktB88j+h6fCYSXouzxbC/A8Lpe3xECkFhXg4dtbbmOwdiL75RNLcsr+Y5KqgUI1ArnDnn0Gf8wx4sfCMbzkNbhGZnh+IKj3ckwHoPWtFBWrG9nzBVNFkC6Qp52WsWPUJETr5FZrBsxQrjw04=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=quarantine dis=none) header.from=redhat.com;\n spf=pass smtp.mailfrom=redhat.com;\n dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com\n header.b=FGrlfbwn; arc=none smtp.client-ip=170.10.133.124","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1777382327;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\t to:to:cc:cc:mime-version:mime-version:\n\t content-transfer-encoding:content-transfer-encoding;\n\tbh=zXHGu2pKvh6nQppVcpyB9iSH+ygOF6hMG1YLx9PkNMc=;\n\tb=FGrlfbwneWZB736Zoc4oZyIPkRgR0xKtyVKv0uf0JW0plVyjiE5htE0WhvslgP9qZaYwey\n\tX7Sk89Z9Uc9G7J/WlL42UisDBq/CakbbDM+YEXfuCScfH4wXVjA4ODymD4KLgklQC0IY1A\n\t3BB6qWnTzlzP2aKawLFS0jlfBpuocPU=","X-MC-Unique":"QRUePlQQOV-Vk5ir6dmz8g-1","X-Mimecast-MFC-AGG-ID":"QRUePlQQOV-Vk5ir6dmz8g_1777382321","From":"David Howells <dhowells@redhat.com>","To":"Christian Brauner <christian@brauner.io>","Cc":"David Howells <dhowells@redhat.com>,\n\tPaulo Alcantara <pc@manguebit.org>,\n\tnetfs@lists.linux.dev,\n\tlinux-afs@lists.infradead.org,\n\tlinux-cifs@vger.kernel.org,\n\tceph-devel@vger.kernel.org,\n\tlinux-fsdevel@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org","Subject":"[PATCH v5 00/24] netfs: Miscellaneous fixes","Date":"Tue, 28 Apr 2026 14:17:30 +0100","Message-ID":"<20260428131756.922303-1-dhowells@redhat.com>","Precedence":"bulk","X-Mailing-List":"linux-cifs@vger.kernel.org","List-Id":"<linux-cifs.vger.kernel.org>","List-Subscribe":"<mailto:linux-cifs+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-cifs+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-Scanned-By":"MIMEDefang 3.4.1 on 10.30.177.111"},"content":"Hi Christian,\n\nHere are the outstanding miscellaneous fixes for netfslib gathered together\nand with some fixes-to-fixes folded down and one rearrangement.  Various\nSashiko review comments[1][2][3][4] are addressed:\n\n (1) Fix subrequest cancellation cleanup in DIO read and single-read.\n\n (2) Fix read and write result collection to use barriering correctly to\n     access a request's subrequest lists without taking a lock.\n\n     This adds list_add_tail_release() and\n     list_first_entry_or_null_acquire() to appropriate incorporate\n     barriering into some list functions.\n\n (3) Fix missing locking around retry adding new subrequests.\n\n (4) Fix netfs_read_to_pagecache() to pause on subrequest I/O failure.\n\n (5) Fix the potential for 64-bit tearing on a 32-bit machine when reading\n     netfs_inode->remote_i_size and ->zero_point by using much the same\n     mechanism as is used for ->i_size.\n\n (6) Fix the calculation of zero_point in netfs_release_folio() to limit it\n     to ->remote_i_size, not ->i_size.\n\n (7) Fix triggering of a VM_BUG_ON_FOLIO() in netfs_write_begin().\n\n (8) Fix error handling in netfs_extract_user_iter().\n\n (9) Fix overrun checking in netfs_extract_user_iter().\n\n(10) Fix a potentially uninitialised error value in\n     netfs_extract_user_iter().\n\n(11) Fix netfs_invalidate_folio() to clear the folio dirty bit if all dirty\n     data removed.\n\n(12) Defer the emission of trace_netfs_folio() in netfs_perform_write().\n     This allows the next patch to emit the correct traces.\n\n(13) Fix the handling of a partially failed copy (ie. EFAULT) into a\n     streaming write folio.  Also remove the netfs_folio if a streaming\n     write folio is entirely overwritten.\n\n(14) Fix a potential deadlock in writethrough writing.\n\n(15) Fix netfs_read_gaps() to remove the netfs_folio from a filled folio.\n\n(16) Fix netfs_perform_write() to not disable streaming writes when writing\n     to an fd that's open O_RDWR.\n\n(17) Fix an early put of the sink page used in netfs_read_gaps(), before\n     the request has completed.\n\n(18) Fix request leak in netfs_write_begin() error handling.\n\n(19) Fix a potential UAF in netfs_unlock_abandoned_read_pages() due to\n     trying to check index of each folio we're abandoning to see if that\n     folio is actually owned by the caller (in which case, we're not\n     actually allowed to dereference it).\n\n(20) Fix incorrect adjustment of dirty region when partially invalidating a\n     streaming write folio.\n\n(21) Fix the handling of folio->private in netfs_perform_write() and the\n     attached netfs_folio and/or group when a streaming write folio is\n     modified.\n\n(22) Fix netfs_read_folio() to wait on writeback first (it holds the folio\n     lock) otherwise we aren't allowed to look at the netfs_folio struct as\n     that could be modified at any time by the writeback collector.\n\n(23) Fix write skipping in dir/symlink writepages.\n\n(24) Fix the locking used by afs_get_link().\n\nThe patches can also be found here:\n\n\thttps://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=netfs-fixes\n\nThanks,\nDavid\n\n[1] https://sashiko.dev/#/patchset/20260414082004.3756080-1-dhowells%40redhat.com\n[2] https://sashiko.dev/#/patchset/20260326104544.509518-1-dhowells%40redhat.com\n[3] https://sashiko.dev/#/patchset/20260425125426.3855807-1-dhowells%40redhat.com\n[4] https://sashiko.dev/#/patchset/20260427154639.180684-1-dhowells%40redhat.com\n\nChanges\n=======\nver #5)\n- Fix more Sashiko issues[4].\n  - Handle missed cancellations in netfs_read_to_pagecache().\n  - Fixed potential double dio-end/put if no subreqs were submitted in dio\n    read.\n  - In netfs_single_dispatch_read(), cancellation needs to set ALL_QUEUED\n    and invoke the collector.\n  - In read/write retry, lock around deletion of subreqs also.\n  - Renamed list_first_entry_acquire() to\n    list_first_entry_or_null_acquire().\n  - In netfs_push_back_zero_point(), fix use of cmpxchg().\n  - Provide netfs_write_remote_i_size_locked() that can be used by a func\n    holding inode->i_lock (e.g. cifs_fattr_to_inode()).\n  - In netfs_extract_user_iter(), improved overrun checking.\n  - Added a patch to fix a potential deadlock with write-through writes.\n  - In netfs_page_mkwrite(), skip the flush if no group set on the folio.\n  - In the single-write users, mark the inode dirty again if a contended\n    lock was skipped due to WB_SYNC_NONE.\n\nver #4)\n- Rebase on v7.0-rc1\n- Fix more Sashiko issues[3].\n  - Move the ->subrequests barriering patch up front as it modifies\n    linux/list.h.\n  - Split that barriering patch and make the first patch to harmonise the\n    order of adding a read subreq to the queue, for buffered, dio and\n    single reads and to fix cancellation on prep failure.  The second patch\n    then fixes the barriering.\n  - Lock ->subrequests in retry when adding in extra subreqs.\n  - Use a spinlock as well when modifying ->zero_point with a seq lock.\n  - Atomically check and change ->zero_point when bumping it up.\n  - Merged the two patches sorting out the locking in afs symlink handling,\n    then fixed a number of issues in them.\n- Added a patch to make afs dir and symlink writepages skip if the\n  validate_lock is held and WB_SYNC_NONE is set.\n\nver #3)\n- Rebase on linus/master.\n- Consolidate the various sets of fixes for reposting.\n- Fold down fixes-to-fixes.\n- Move the tracing change in netfs_perform_write() down to below the patch\n  it primarily affects.\n\nbase-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731\n\nDavid Howells (22):\n  netfs: Fix cancellation of a DIO and single read subrequests\n  netfs: Fix missing locking around retry adding new subreqs\n  netfs: Fix missing barriers when accessing stream->subrequests\n    locklessly\n  netfs: Fix netfs_read_to_pagecache() to pause on subreq failure\n  netfs: Fix potential for tearing in ->remote_i_size and ->zero_point\n  netfs: Fix zeropoint update where i_size > remote_i_size\n  netfs: Fix overrun check in netfs_extract_user_iter()\n  netfs: Fix potential uninitialised var in netfs_extract_user_iter()\n  netfs: Fix netfs_invalidate_folio() to clear dirty bit if all changes\n    gone\n  netfs: Defer the emission of trace_netfs_folio()\n  netfs: Fix streaming write being overwritten\n  netfs: Fix potential deadlock in write-through mode\n  netfs: Fix read-gaps to remove netfs_folio from filled folio\n  netfs: Fix write streaming disablement if fd open O_RDWR\n  netfs: Fix early put of sink folio in netfs_read_gaps()\n  netfs: Fix leak of request in netfs_write_begin() error handling\n  netfs: Fix potential UAF in netfs_unlock_abandoned_read_pages()\n  netfs: Fix partial invalidation of streaming-write folio\n  netfs: Fix folio->private handling in netfs_perform_write()\n  netfs: Fix netfs_read_folio() to wait on writeback\n  netfs, afs: Fix write skipping in dir/link writepages\n  afs: Fix the locking used by afs_get_link()\n\nPaulo Alcantara (1):\n  netfs: fix error handling in netfs_extract_user_iter()\n\nViacheslav Dubeyko (1):\n  netfs: fix VM_BUG_ON_FOLIO() issue in netfs_write_begin() call\n\n fs/9p/vfs_inode.c            |   2 +-\n fs/9p/vfs_inode_dotl.c       |   4 +-\n fs/afs/Makefile              |   1 +\n fs/afs/dir.c                 |  79 ++++----\n fs/afs/fsclient.c            |   4 +-\n fs/afs/inode.c               | 104 +---------\n fs/afs/internal.h            |  34 +++-\n fs/afs/symlink.c             | 270 ++++++++++++++++++++++++++\n fs/afs/validation.c          |   8 +-\n fs/afs/write.c               |   2 +-\n fs/afs/yfsclient.c           |   4 +-\n fs/netfs/buffered_read.c     |  71 +++----\n fs/netfs/buffered_write.c    | 161 ++++++++++------\n fs/netfs/direct_read.c       |  42 ++--\n fs/netfs/direct_write.c      |   4 +-\n fs/netfs/internal.h          |   3 +\n fs/netfs/iterator.c          |  36 ++--\n fs/netfs/misc.c              |  22 ++-\n fs/netfs/read_collect.c      |  19 +-\n fs/netfs/read_retry.c        |  17 +-\n fs/netfs/read_single.c       |  23 +--\n fs/netfs/write_collect.c     |   9 +-\n fs/netfs/write_issue.c       |  18 +-\n fs/netfs/write_retry.c       |   6 +-\n fs/smb/client/cifsfs.c       |  28 +--\n fs/smb/client/cifssmb.c      |   2 +-\n fs/smb/client/file.c         |   9 +-\n fs/smb/client/inode.c        |   9 +-\n fs/smb/client/readdir.c      |   3 +-\n fs/smb/client/smb2ops.c      |  16 +-\n fs/smb/client/smb2pdu.c      |   2 +-\n include/linux/list.h         |  37 ++++\n include/linux/netfs.h        | 364 ++++++++++++++++++++++++++++++++++-\n include/trace/events/netfs.h |   8 +\n 34 files changed, 1056 insertions(+), 365 deletions(-)\n create mode 100644 fs/afs/symlink.c"}