From: Jingbo Xu <jefflexu@linux.alibaba.com>
To: dhowells@redhat.com, linux-cachefs@redhat.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] cachefiles: don't align the write IO in ondemand mode
Date: Tue, 21 Feb 2023 18:33:12 +0800 [thread overview]
Message-ID: <20230221103313.120834-2-jefflexu@linux.alibaba.com> (raw)
In-Reply-To: <20230221103313.120834-1-jefflexu@linux.alibaba.com>
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
next prev parent reply other threads:[~2023-02-21 10:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-21 10:33 [PATCH 0/2] fscache/cachefiles: some work for on-demand mode Jingbo Xu
2023-02-21 10:33 ` Jingbo Xu [this message]
2023-02-21 10:33 ` [PATCH 2/2] fscache: introduce fscache_begin_wait_operation() helper Jingbo Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230221103313.120834-2-jefflexu@linux.alibaba.com \
--to=jefflexu@linux.alibaba.com \
--cc=dhowells@redhat.com \
--cc=linux-cachefs@redhat.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®