[lkml]   [2023]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[PATCH 0/2] fscache/cachefiles: some work for on-demand mode
Hi there's some work to make users of fscache on-demand mode support
PAGE_SIZE larger than 4KB (e.g. 16/64KB in aarch64) [1]. I think they
may be also useful for other users of fscache/cachefiles.

Strictly speacking, patch 1 is a bug fix though the issue doesn't cause
serious harm when erofs doesn't support large PAGE_SIZE (other than

__cachefiles_prepare_write() will align the requested file range to
PAGE_SIZE boundary. This is reasonable for libnetfs as libnetfs will
construct an iter with the aligned file range from the ground.

While for fscache on-demand mode, cachefiles_ondemand_fd_write_iter() is
called by the user daemon, and thus it is unexpected to align the file
range to PAGE_SIZE boundary, as the iov_iter/kiocb is given by the user
daemon. If the given file range is not aligned with the block size of
the backing filesystem, let's fail the write directly.

Patch 2 adds a new helper, by which users of fscache on-demand mode
could wait for the wrangling of the cache object and then derive the
object size (set in cachefiles_ondemand_copen()).
fscache_begin_read_operation() is not feasible for this purpose as
in this case @want_state is FSCACHE_WANT_PARAMS and it will not wait
there for object wrangling when cookie is in
FSCACHE_COOKIE_STATE_CREATING state. An example use case of this helper
is illustrated in [2].

Any comment is welcomed.


Jingbo Xu (2):
cachefiles: don't align the write IO in ondemand mode
fscache: introduce fscache_begin_wait_operation() helper

fs/cachefiles/ondemand.c | 3 ++-
fs/fscache/io.c | 9 +++++++++
include/linux/fscache.h | 22 ++++++++++++++++++++++
3 files changed, 33 insertions(+), 1 deletion(-)


 \ /
  Last update: 2023-03-27 00:29    [W:0.026 / U:0.676 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site