提交 9074c8b7 编写于 作者: T Takashi Iwai 提交者: Zheng Zengkai

cachefiles: Drop superfluous readpages aops NULL check

stable inclusion
from stable-5.10.11
commit 76e2b0b65d47206754084233d268d57ade2a988e
bugzilla: 47621

--------------------------------

commit db58465f upstream.

After the recent actions to convert readpages aops to readahead, the
NULL checks of readpages aops in cachefiles_read_or_alloc_page() may
hit falsely.  More badly, it's an ASSERT() call, and this panics.

Drop the superfluous NULL checks for fixing this regression.

[DH: Note that cachefiles never actually used readpages, so this check was
 never actually necessary]

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=208883
BugLink: https://bugzilla.opensuse.org/show_bug.cgi?id=1175245
Fixes: 9ae326a6 ("CacheFiles: A cache that backs onto a mounted filesystem")
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
Signed-off-by: NDavid Howells <dhowells@redhat.com>
Acked-by: NMatthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 2fb0638d
...@@ -413,7 +413,6 @@ int cachefiles_read_or_alloc_page(struct fscache_retrieval *op, ...@@ -413,7 +413,6 @@ int cachefiles_read_or_alloc_page(struct fscache_retrieval *op,
inode = d_backing_inode(object->backer); inode = d_backing_inode(object->backer);
ASSERT(S_ISREG(inode->i_mode)); ASSERT(S_ISREG(inode->i_mode));
ASSERT(inode->i_mapping->a_ops->readpages);
/* calculate the shift required to use bmap */ /* calculate the shift required to use bmap */
shift = PAGE_SHIFT - inode->i_sb->s_blocksize_bits; shift = PAGE_SHIFT - inode->i_sb->s_blocksize_bits;
...@@ -713,7 +712,6 @@ int cachefiles_read_or_alloc_pages(struct fscache_retrieval *op, ...@@ -713,7 +712,6 @@ int cachefiles_read_or_alloc_pages(struct fscache_retrieval *op,
inode = d_backing_inode(object->backer); inode = d_backing_inode(object->backer);
ASSERT(S_ISREG(inode->i_mode)); ASSERT(S_ISREG(inode->i_mode));
ASSERT(inode->i_mapping->a_ops->readpages);
/* calculate the shift required to use bmap */ /* calculate the shift required to use bmap */
shift = PAGE_SHIFT - inode->i_sb->s_blocksize_bits; shift = PAGE_SHIFT - inode->i_sb->s_blocksize_bits;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册