lkml.org 
[lkml]   [2023]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] cachefiles: don't align the write IO in ondemand mode
Date
If the write IO requested by the user daemon is not aligned with the
block size of the backing filesystem, it's expected to fail directly
rather than submit the aligned write IO (with expanded file range
unmatching with the given iov_iter).

Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
---
fs/cachefiles/ondemand.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/cachefiles/ondemand.c b/fs/cachefiles/ondemand.c
index 0254ed39f68c..c017aca2a8a2 100644
--- a/fs/cachefiles/ondemand.c
+++ b/fs/cachefiles/ondemand.c
@@ -52,7 +52,8 @@ static ssize_t cachefiles_ondemand_fd_write_iter(struct kiocb *kiocb,
return -ENOBUFS;

cachefiles_begin_secure(cache, &saved_cred);
- ret = __cachefiles_prepare_write(object, file, &pos, &len, true);
+ ret = cachefiles_has_space(cache, 0, len >> cache->bshift,
+ cachefiles_has_space_for_write);
cachefiles_end_secure(cache, saved_cred);
if (ret < 0)
return ret;
--
2.19.1.6.gb485710b
\
 
 \ /
  Last update: 2023-03-27 00:29    [W:0.313 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site