summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2026-09-10 23:02:40 +0100
committerChristian Brauner <brauner@kernel.org>2026-10-06 15:32:37 +0200
commit25c034ac3d2e39655aa03b5fee375bf84108208c (patch)
tree1a63029adb9e8c66d926ca1e1e9020baea1ab1e1 /tools/lib/python
parent13e340e3974ce380d9b0f7f0fbc47dc578a365f4 (diff)
downloadlinux-next-25c034ac3d2e39655aa03b5fee375bf84108208c.tar.gz
linux-next-25c034ac3d2e39655aa03b5fee375bf84108208c.zip
cachefiles: Preset the state xattr when creating a new file
With a really small cache, cachefiles is likely to see a lot of writes hitting ENOSPC - and this can include setxattr that sets the state xattr on a cachefile - but we don't really want to successfully fill a cache file only to have to scrap it because we can't set the xattr. Instead, preset the xattr when we create the tmpfile we're going to use, and scrap the file at that point if we get ENOSPC. Only if setxattr succeeds do we allow data to be written to the file. Note that there is a potential performance loss in that writes to the cache have to be delayed until this is completed - but we do the tmpfile/setxattr in parallel, starting when the file is opened and only have to wait once writeback occurs. Signed-off-by: David Howells <dhowells@redhat.com> Link: https://patch.msgid.link/20260910220242.2165023-6-dhowells@redhat.com Reviewed-by: Paulo Alcantara <pc@manguebit.org> cc: Marc Dionne <marc.dionne@auristor.com> cc: Paulo Alcantara <pc@manguebit.org> cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions