<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/fs/cachefiles, branch stable/6.2.y</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=stable%2F6.2.y</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=stable%2F6.2.y'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2022-12-07T02:56:29Z</updated>
<entry>
<title>fscache,cachefiles: add prepare_ondemand_read() callback</title>
<updated>2022-12-07T02:56:29Z</updated>
<author>
<name>Jingbo Xu</name>
<email>jefflexu@linux.alibaba.com</email>
</author>
<published>2022-11-24T03:42:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8669247524c73e16e4d3384c4ff882e5c5d06194'/>
<id>urn:sha1:8669247524c73e16e4d3384c4ff882e5c5d06194</id>
<content type='text'>
Add prepare_ondemand_read() callback dedicated for the on-demand read
scenario, so that callers from this scenario can be decoupled from
netfs_io_subrequest.

The original cachefiles_prepare_read() is now refactored to a generic
routine accepting a parameter list instead of netfs_io_subrequest.
There's no logic change, except that the debug id of subrequest and
request is removed from trace_cachefiles_prep_read().

Reviewed-by: Jeff Layton &lt;jlayton@kernel.org&gt;
Signed-off-by: Jingbo Xu &lt;jefflexu@linux.alibaba.com&gt;
Acked-by: David Howells &lt;dhowells@redhat.com&gt;
Link: https://lore.kernel.org/r/20221124034212.81892-2-jefflexu@linux.alibaba.com
Signed-off-by: Gao Xiang &lt;hsiangkao@linux.alibaba.com&gt;
</content>
</entry>
<entry>
<title>cachefiles: use vfs_tmpfile_open() helper</title>
<updated>2022-09-24T05:00:00Z</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@redhat.com</email>
</author>
<published>2022-09-24T05:00:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=24a81759b65fa85767739999d91523691c5e2ea5'/>
<id>urn:sha1:24a81759b65fa85767739999d91523691c5e2ea5</id>
<content type='text'>
Use the vfs_tmpfile_open() helper instead of doing tmpfile creation and
opening separately.

The only minor difference is that previously no permission checking was
done, while vfs_tmpfile_open() will call may_open() with zero access mask
(i.e. no access is checked).  Even if this would make a difference with
callers caps (don't see how it could, even in the LSM codepaths) cachfiles
raises caps before performing the tmpfile creation, so this extra
permission check will not result in any regression.

Reviewed-by: Christian Brauner (Microsoft) &lt;brauner@kernel.org&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>cachefiles: only pass inode to *mark_inode_inuse() helpers</title>
<updated>2022-09-24T04:59:59Z</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@redhat.com</email>
</author>
<published>2022-09-24T04:59:59Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=08d7a6fb7e44ae0f54f7903888dc41e31dfbc9da'/>
<id>urn:sha1:08d7a6fb7e44ae0f54f7903888dc41e31dfbc9da</id>
<content type='text'>
The only reason to pass dentry was because of a pr_notice() text.  Move
that to the two callers where it makes sense and add a WARN_ON() to the
third.

file_inode(file) is never NULL on an opened file. Remove check in
cachefiles_unmark_inode_in_use().

Do not open code cachefiles_do_unmark_inode_in_use() in
cachefiles_put_directory().

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>cachefiles: tmpfile error handling cleanup</title>
<updated>2022-09-24T04:59:59Z</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@redhat.com</email>
</author>
<published>2022-09-24T04:59:59Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=38017d44441efa695997d4f09d09d9d312f40088'/>
<id>urn:sha1:38017d44441efa695997d4f09d09d9d312f40088</id>
<content type='text'>
Separate the error labels from the success path and use 'ret' to store the
error value before jumping to the error label.

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>cachefiles: make on-demand request distribution fairer</title>
<updated>2022-08-31T15:41:10Z</updated>
<author>
<name>Xin Yin</name>
<email>yinxin.x@bytedance.com</email>
</author>
<published>2022-08-25T02:09:45Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1122f40072731525c06b1371cfa30112b9b54d27'/>
<id>urn:sha1:1122f40072731525c06b1371cfa30112b9b54d27</id>
<content type='text'>
For now, enqueuing and dequeuing on-demand requests all start from
idx 0, this makes request distribution unfair. In the weighty
concurrent I/O scenario, the request stored in higher idx will starve.

Searching requests cyclically in cachefiles_ondemand_daemon_read,
makes distribution fairer.

Fixes: c8383054506c ("cachefiles: notify the user daemon when looking up cookie")
Reported-by: Yongqing Li &lt;liyongqing@bytedance.com&gt;
Signed-off-by: Xin Yin &lt;yinxin.x@bytedance.com&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Reviewed-by: Jeffle Xu &lt;jefflexu@linux.alibaba.com&gt;
Reviewed-by: Gao Xiang &lt;hsiangkao@linux.alibaba.com&gt;
Link: https://lore.kernel.org/r/20220817065200.11543-1-yinxin.x@bytedance.com/ # v1
Link: https://lore.kernel.org/r/20220825020945.2293-1-yinxin.x@bytedance.com/ # v2
</content>
</entry>
<entry>
<title>cachefiles: fix error return code in cachefiles_ondemand_copen()</title>
<updated>2022-08-31T15:41:10Z</updated>
<author>
<name>Sun Ke</name>
<email>sunke32@huawei.com</email>
</author>
<published>2022-08-26T02:35:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c93ccd63b18c8d108c57b2bb0e5f3b058b9d2029'/>
<id>urn:sha1:c93ccd63b18c8d108c57b2bb0e5f3b058b9d2029</id>
<content type='text'>
The cache_size field of copen is specified by the user daemon.
If cache_size &lt; 0, then the OPEN request is expected to fail,
while copen itself shall succeed. However, returning 0 is indeed
unexpected when cache_size is an invalid error code.

Fix this by returning error when cache_size is an invalid error code.

Changes
=======
v4: update the code suggested by Dan
v3: update the commit log suggested by Jingbo.

Fixes: c8383054506c ("cachefiles: notify the user daemon when looking up cookie")
Signed-off-by: Sun Ke &lt;sunke32@huawei.com&gt;
Suggested-by: Jeffle Xu &lt;jefflexu@linux.alibaba.com&gt;
Suggested-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Reviewed-by: Gao Xiang &lt;hsiangkao@linux.alibaba.com&gt;
Reviewed-by: Jingbo Xu &lt;jefflexu@linux.alibaba.com&gt;
Reviewed-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Link: https://lore.kernel.org/r/20220818111935.1683062-1-sunke32@huawei.com/ # v2
Link: https://lore.kernel.org/r/20220818125038.2247720-1-sunke32@huawei.com/ # v3
Link: https://lore.kernel.org/r/20220826023515.3437469-1-sunke32@huawei.com/ # v4
</content>
</entry>
<entry>
<title>cachefiles: narrow the scope of flushed requests when releasing fd</title>
<updated>2022-07-05T15:12:21Z</updated>
<author>
<name>Jia Zhu</name>
<email>zhujia.zj@bytedance.com</email>
</author>
<published>2022-06-09T08:54:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=65aa5f6fd8a12e0a343aaf1815949a79a49e3f35'/>
<id>urn:sha1:65aa5f6fd8a12e0a343aaf1815949a79a49e3f35</id>
<content type='text'>
When an anonymous fd is released, only flush the requests
associated with it, rather than all of requests in xarray.

Fixes: 9032b6e8589f ("cachefiles: implement on-demand read")
Signed-off-by: Jia Zhu &lt;zhujia.zj@bytedance.com&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Reviewed-by: Jeffle Xu &lt;jefflexu@linux.alibaba.com&gt;
Reviewed-by: Gao Xiang &lt;hsiangkao@linux.alibaba.com&gt;
Link: https://listman.redhat.com/archives/linux-cachefs/2022-June/006937.html
</content>
</entry>
<entry>
<title>cachefiles: add tracepoints for on-demand read mode</title>
<updated>2022-05-17T16:11:18Z</updated>
<author>
<name>Jeffle Xu</name>
<email>jefflexu@linux.alibaba.com</email>
</author>
<published>2022-04-25T12:21:29Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1519670e4fecc6063fa2f0c10f0666d3331f219b'/>
<id>urn:sha1:1519670e4fecc6063fa2f0c10f0666d3331f219b</id>
<content type='text'>
Add tracepoints for on-demand read mode. Currently following tracepoints
are added:

	OPEN request / COPEN reply
	CLOSE request
	READ request / CREAD reply
	write through anonymous fd
	release of anonymous fd

Signed-off-by: Jeffle Xu &lt;jefflexu@linux.alibaba.com&gt;
Acked-by: David Howells &lt;dhowells@redhat.com&gt;
Link: https://lore.kernel.org/r/20220425122143.56815-8-jefflexu@linux.alibaba.com
Signed-off-by: Gao Xiang &lt;hsiangkao@linux.alibaba.com&gt;
</content>
</entry>
<entry>
<title>cachefiles: enable on-demand read mode</title>
<updated>2022-05-17T16:11:18Z</updated>
<author>
<name>Jeffle Xu</name>
<email>jefflexu@linux.alibaba.com</email>
</author>
<published>2022-04-25T12:21:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4e4f1788af0e477bca079e5b1ffc42846b3bafee'/>
<id>urn:sha1:4e4f1788af0e477bca079e5b1ffc42846b3bafee</id>
<content type='text'>
Enable on-demand read mode by adding an optional parameter to the "bind"
command.

On-demand mode will be turned on when this parameter is "ondemand", i.e.
"bind ondemand". Otherwise cachefiles will work in the original mode.

Signed-off-by: Jeffle Xu &lt;jefflexu@linux.alibaba.com&gt;
Link: https://lore.kernel.org/r/20220509074028.74954-7-jefflexu@linux.alibaba.com
Acked-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Gao Xiang &lt;hsiangkao@linux.alibaba.com&gt;
</content>
</entry>
<entry>
<title>cachefiles: implement on-demand read</title>
<updated>2022-05-17T16:11:18Z</updated>
<author>
<name>Jeffle Xu</name>
<email>jefflexu@linux.alibaba.com</email>
</author>
<published>2022-04-25T12:21:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9032b6e8589f269743984aac53e82e4835be16dc'/>
<id>urn:sha1:9032b6e8589f269743984aac53e82e4835be16dc</id>
<content type='text'>
Implement the data plane of on-demand read mode.

The early implementation [1] place the entry to
cachefiles_ondemand_read() in fscache_read(). However, fscache_read()
can only detect if the requested file range is fully cache miss, whilst
we need to notify the user daemon as long as there's a hole inside the
requested file range.

Thus the entry is now placed in cachefiles_prepare_read(). When working
in on-demand read mode, once a hole detected, the read routine will send
a READ request to the user daemon. The user daemon needs to fetch the
data and write it to the cache file. After sending the READ request, the
read routine will hang there, until the READ request is handled by the
user daemon. Then it will retry to read from the same file range. If no
progress encountered, the read routine will fail then.

A new NETFS_SREQ_ONDEMAND flag is introduced to indicate that on-demand
read should be done when a cache miss encountered.

[1] https://lore.kernel.org/all/20220406075612.60298-6-jefflexu@linux.alibaba.com/ #v8

Signed-off-by: Jeffle Xu &lt;jefflexu@linux.alibaba.com&gt;
Acked-by: David Howells &lt;dhowells@redhat.com&gt;
Link: https://lore.kernel.org/r/20220425122143.56815-6-jefflexu@linux.alibaba.com
Signed-off-by: Gao Xiang &lt;hsiangkao@linux.alibaba.com&gt;
</content>
</entry>
</feed>
