The commit, cachefiles: drop direct usage of ->bmap method., included in v5.5 has a bug. The return value before list_for_each_entry_safe
, that is ret = space ? -ENODATA : -ENOBUFS
, overwritten by the return value of bmap
. This bug exists in Linux 5.6.2 at least.
The following is a patch to fix this bug. This patch also includes https://lkml.org/lkml/2020/3/20/399.
--- a/fs/cachefiles/rdwr.c
+++ b/fs/cachefiles/rdwr.c
@@ -431,7 +431,7 @@ int cachefiles_read_or_alloc_page(struct fscache_retrieval *op,
block <<= shift;
ret = bmap(inode, &block);
- ASSERT(ret < 0);
+ ASSERT(!ret);
_debug("%llx -> %llx",
(unsigned long long) (page->index << shift),
@@ -739,8 +739,8 @@ int cachefiles_read_or_alloc_pages(struct fscache_retrieval *op,
block = page->index;
block <<= shift;
- ret = bmap(inode, &block);
- ASSERT(!ret);
+ ret2 = bmap(inode, &block);
+ ASSERT(!ret2);
_debug("%llx -> %llx",
(unsigned long long) (page->index << shift),
Update (2020/5/24)
This bug has been fixed in Linux 5.6.14 while fixed in v5.7-rc6 as for the master branch.
Related articles
- 2021/01/13 21:27 / brtfs 上に swap ファイルを置く
- 2020/09/11 20:24 / Linux 5.9-rc4
- 2020/07/12 16:42 / Linux 5.8-rc4
- 2020/05/01 21:21 / Linux 5.7-rc1
- 2020/02/22 19:33 / Linux 5.6-rc2
- 2020/01/11 20:50 / Linux 5.5-rc5
- 2019/11/25 14:45 / nvidia-kernel-dkms 418.74-1 with Linux 5.4
- 2019/10/02 00:03 / Linux 5.3.1 -> 5.4-rc1
- 2019/09/20 14:45 / nvidia-kernel-dkms 418.74-1 with Linux 5.3
- 2019/07/22 19:13 / Linux 5.2.2 -> 5.3-rc1
- 2019/06/28 20:38 / GeForce GT 430 with nvidia-legacy-390xx-kernel-dkms 390.116-1~bpo9+1
- 2019/06/12 16:10 / Linux 5.1.8 -> 5.2-rc4
- 2019/05/07 19:43 / Linux 5.0.9 -> 5.1.0
- 2019/03/07 22:16 / Linux 4.20.13 -> 5.0.0
- 2018/11/06 11:30 / Linux 4.19.0 -> 4.20-rc1
- 2018/08/29 11:06 / Linux 4.18.5 -> 4.19-rc1
- 2018/06/20 17:06 / Linux 4.17.2 -> 4.18-rc1
- 2018/04/19 15:25 / Linux 4.16.2 -> 4.17-rc1
- 2018/02/12 17:23 / Linux 4.15.3 -> 4.16-rc1
- 2018/01/29 11:08 / Linux 4.14.15 -> 4.15
- 2017/11/28 12:42 / Linux 4.14.2 -> 4.15-rc1
- 2017/11/15 15:56 / Linux ORC unwinder と objtool (CONFIG_STACK_VALIDATION needs tools/objtool/objtool along headers)
- 2017/11/15 15:41 / Linux 4.13.12 -> 4.14.0
- 2017/09/18 07:04 / Linux 4.13.1 -> 4.14-rc1
- 2017/09/05 04:14 / Linux 4.12.10 -> 4.13
- 2017/07/16 23:56 / Linux 4.12.0 -> 4.13-rc1
- 2017/05/15 14:04 / Linux 4.11.0 -> 4.12-rc1
- 2017/05/03 00:24 / Linux 4.10.13 -> 4.11.0
- 2017/03/06 09:51 / Linux 4.10.1 -> 4.11-rc1
- 2017/02/20 10:31 / Linux 4.9.X -> 4.10
- 2016/12/30 21:28 / Linux 4.9 -> 4.10-rc1
- 2016/12/14 23:00 / Linux 4.8 -> 4.9