Linux filesystem development
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Christian Brauner <christian@brauner.io>
Cc: David Howells <dhowells@redhat.com>,
	Paulo Alcantara <pc@manguebit.org>,
	Christoph Hellwig <hch@infradead.org>,
	netfs@lists.linux.dev, linux-afs@lists.infradead.org,
	linux-cifs@vger.kernel.org, ceph-devel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v3 02/15] netfs: Fix netfs_create_write_req() to handle async cache object creation
Date: Thu, 25 Jun 2026 15:06:20 +0100	[thread overview]
Message-ID: <20260625140640.3116900-3-dhowells@redhat.com> (raw)
In-Reply-To: <20260625140640.3116900-1-dhowells@redhat.com>

netfs_create_write_req() will skip caching if the fscache cookie is
disabled, but this is a problem because async cache object creation might
not have got far enough yet that has been enabled - thereby causing the
call to fscache_begin_write_operation() to be skipped.

Fix this by removing the checks on the cookie and delegating this to
fscache_begin_write_operation().

Fixes: 7b589a9b45ae ("netfs: Fix handling of USE_PGPRIV2 and WRITE_TO_CACHE flags")
Closes: https://sashiko.dev/#/patchset/20260624115737.2964520-1-dhowells%40redhat.com
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Paulo Alcantara <pc@manguebit.org>
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
---
 fs/netfs/write_issue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/netfs/write_issue.c b/fs/netfs/write_issue.c
index c03c7cc45e47..4f55228f0fd4 100644
--- a/fs/netfs/write_issue.c
+++ b/fs/netfs/write_issue.c
@@ -106,7 +106,7 @@ struct netfs_io_request *netfs_create_write_req(struct address_space *mapping,
 	_enter("R=%x", wreq->debug_id);
 
 	ictx = netfs_inode(wreq->inode);
-	if (is_cacheable && netfs_is_cache_enabled(ictx))
+	if (is_cacheable)
 		fscache_begin_write_operation(&wreq->cache_resources, netfs_i_cookie(ictx));
 	if (rolling_buffer_init(&wreq->buffer, wreq->debug_id, ITER_SOURCE) < 0)
 		goto nomem;


  parent reply	other threads:[~2026-06-25 14:07 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-25 14:06 [PATCH v3 00/15] netfs: Miscellaneous fixes David Howells
2026-06-25 14:06 ` [PATCH v3 01/15] netfs: Fix decision whether to disallow write-streaming due to fscache use David Howells
2026-06-25 14:06 ` David Howells [this message]
2026-06-25 14:06 ` [PATCH v3 03/15] cachefiles: Fix double fput David Howells
2026-06-25 14:06 ` [PATCH v3 04/15] cachefiles: Fix file burial to take lock when unsetting S_KERNEL_FILE David Howells
2026-06-26  3:17   ` NeilBrown
2026-06-25 14:06 ` [PATCH v3 05/15] iov_iter: Fix potential underflow in iov_iter_extract_xarray_pages() David Howells
2026-06-26  5:49   ` Christoph Hellwig
2026-06-25 14:06 ` [PATCH v3 06/15] iov_iter: Fix missing alloc fail check in iov_iter_extract_bvec_pages() David Howells
2026-06-26  5:50   ` Christoph Hellwig
2026-06-25 14:06 ` [PATCH v3 07/15] iov_iter: Fix a memory leak in iov_iter_extract_user_pages() David Howells
2026-06-26  5:50   ` Christoph Hellwig
2026-06-25 14:06 ` [PATCH v3 08/15] iov_iter: Remove unused variable in kunit_iov_iter.c David Howells
2026-06-26  5:51   ` Christoph Hellwig
2026-06-25 14:06 ` [PATCH v3 09/15] scatterlist: Fix offset in folio calc in extract_xarray_to_sg() David Howells
2026-06-26  5:51   ` Christoph Hellwig
2026-06-25 14:06 ` [PATCH v3 10/15] netfs: Fix kdoc warning David Howells
2026-06-25 14:06 ` [PATCH v3 11/15] netfs: Replace wb_lock with a bit lock for asynchronicity David Howells
2026-06-25 14:06 ` [PATCH v3 12/15] netfs: Fix writethrough to use collection offload David Howells
2026-06-25 14:06 ` [PATCH v3 13/15] netfs: Fix writeback error handling David Howells
2026-06-25 14:06 ` [PATCH v3 14/15] netfs: Fix folio state after ENOMEM whilst under writeback iteration David Howells
2026-06-25 14:06 ` [PATCH v3 15/15] netfs: Fix DIO write retry for filesystems without a ->prepare_write() David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260625140640.3116900-3-dhowells@redhat.com \
    --to=dhowells@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=christian@brauner.io \
    --cc=hch@infradead.org \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netfs@lists.linux.dev \
    --cc=pc@manguebit.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox