linux-stable/fs/cachefiles
Jia Zhu 0a7e54c195
cachefiles: resend an open request if the read request's object is closed
When an anonymous fd is closed by user daemon, if there is a new read
request for this file comes up, the anonymous fd should be re-opened
to handle that read request rather than fail it directly.

1. Introduce reopening state for objects that are closed but have
   inflight/subsequent read requests.
2. No longer flush READ requests but only CLOSE requests when anonymous
   fd is closed.
3. Enqueue the reopen work to workqueue, thus user daemon could get rid
   of daemon_read context and handle that request smoothly. Otherwise,
   the user daemon will send a reopen request and wait for itself to
   process the request.

Signed-off-by: Jia Zhu <zhujia.zj@bytedance.com>
Link: https://lore.kernel.org/r/20231120041422.75170-4-zhujia.zj@bytedance.com
Reviewed-by: Jingbo Xu <jefflexu@linux.alibaba.com>
Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
2023-11-25 16:03:57 +01:00
..
Kconfig cachefiles: notify the user daemon when looking up cookie 2022-05-18 00:11:17 +08:00
Makefile cachefiles: notify the user daemon when looking up cookie 2022-05-18 00:11:17 +08:00
cache.c cachefiles: Check that the backing filesystem supports tmpfiles 2022-01-21 21:36:28 +00:00
daemon.c cachefiles: enable on-demand read mode 2022-05-18 00:11:18 +08:00
error_inject.c fs/cachefiles: simplify one-level sysctl registration for cachefiles_sysctls 2023-04-13 11:49:35 -07:00
interface.c cachefiles: extract ondemand info field from cachefiles_object 2023-11-25 16:03:57 +01:00
internal.h cachefiles: resend an open request if the read request's object is closed 2023-11-25 16:03:57 +01:00
io.c cachefiles: use kiocb_{start,end}_write() helpers 2023-08-21 17:27:27 +02:00
key.c cachefiles: Implement key to filename encoding 2022-01-07 13:42:16 +00:00
main.c cachefiles: Implement object lifecycle funcs 2022-01-07 13:42:08 +00:00
namei.c mm, netfs, fscache: stop read optimisation when folio removed from pagecache 2023-08-18 10:12:13 -07:00
ondemand.c cachefiles: resend an open request if the read request's object is closed 2023-11-25 16:03:57 +01:00
security.c cachefiles: Add security derivation 2022-01-07 13:41:14 +00:00
volume.c fscache, cachefiles: Store the volume coherency data 2022-01-07 13:43:03 +00:00
xattr.c fs: port ->permission() to pass mnt_idmap 2023-01-19 09:24:28 +01:00