diff options
| author | David Howells <[email protected]> | 2024-12-13 13:50:04 +0000 |
|---|---|---|
| committer | Christian Brauner <[email protected]> | 2024-12-20 21:07:56 +0000 |
| commit | 86ad1a58f6a9453f49e06ef957a40a8dac00a13f (patch) | |
| tree | 968d12c9bfdf80c94ce9328a2dddb19417648b2f /fs/cachefiles/internal.h | |
| parent | netfs: Fix enomem handling in buffered reads (diff) | |
| download | kernel-86ad1a58f6a9453f49e06ef957a40a8dac00a13f.tar.gz kernel-86ad1a58f6a9453f49e06ef957a40a8dac00a13f.zip | |
nfs: Fix oops in nfs_netfs_init_request() when copying to cache
When netfslib wants to copy some data that has just been read on behalf of
nfs, it creates a new write request and calls nfs_netfs_init_request() to
initialise it, but with a NULL file pointer. This causes
nfs_file_open_context() to oops - however, we don't actually need the nfs
context as we're only going to write to the cache.
Fix this by just returning if we aren't given a file pointer and emit a
warning if the request was for something other than copy-to-cache.
Further, fix nfs_netfs_free_request() so that it doesn't try to free the
context if the pointer is NULL.
Fixes: ee4cdf7ba857 ("netfs: Speed up buffered reading")
Reported-by: Max Kellermann <[email protected]>
Closes: https://lore.kernel.org/r/CAKPOu+9DyMbKLhyJb7aMLDTb=Fh0T8Teb9sjuf_pze+XWT1VaQ@mail.gmail.com/
Signed-off-by: David Howells <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
cc: Trond Myklebust <[email protected]>
cc: Anna Schumaker <[email protected]>
cc: Dave Wysochanski <[email protected]>
cc: Jeff Layton <[email protected]>
cc: [email protected]
cc: [email protected]
cc: [email protected]
Signed-off-by: Christian Brauner <[email protected]>
Diffstat (limited to 'fs/cachefiles/internal.h')
0 files changed, 0 insertions, 0 deletions
