summaryrefslogtreecommitdiffstats
path: root/fs/smb
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2023-11-22 17:18:17 +0000
committerDavid Howells <dhowells@redhat.com>2023-12-28 09:45:25 +0000
commite0ace6ca98bef0d8d354040f13ffc0a498813ee9 (patch)
treebf426f6aa6e3c0fa9f4b186eb79857675b7148ae /fs/smb
parent80645bd4aa33a5c325f11b8dc6b38b38410ad5c0 (diff)
downloadlinux-stable-e0ace6ca98bef0d8d354040f13ffc0a498813ee9.tar.gz
linux-stable-e0ace6ca98bef0d8d354040f13ffc0a498813ee9.tar.bz2
linux-stable-e0ace6ca98bef0d8d354040f13ffc0a498813ee9.zip
netfs, cachefiles: Pass upper bound length to allow expansion
Make netfslib pass the maximum length to the ->prepare_write() op to tell the cache how much it can expand the length of a write to. This allows a write to the server at the end of a file to be limited to a few bytes whilst writing an entire block to the cache (something required by direct I/O). Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> cc: linux-cachefs@redhat.com cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org
Diffstat (limited to 'fs/smb')
-rw-r--r--fs/smb/client/fscache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/smb/client/fscache.c b/fs/smb/client/fscache.c
index e5cad149f5a2..c4a3cb736881 100644
--- a/fs/smb/client/fscache.c
+++ b/fs/smb/client/fscache.c
@@ -180,7 +180,7 @@ static int fscache_fallback_write_pages(struct inode *inode, loff_t start, size_
if (ret < 0)
return ret;
- ret = cres.ops->prepare_write(&cres, &start, &len, i_size_read(inode),
+ ret = cres.ops->prepare_write(&cres, &start, &len, len, i_size_read(inode),
no_space_allocated_yet);
if (ret == 0)
ret = fscache_write(&cres, start, &iter, NULL, NULL);