Skip to contentSkip to conversation

fs/cachefiles: Drop superfluous readpages aops NULL check

PATCH In review Takashi Iwai 2 participants 2 messages Aug 27, 2020 – Oct 14, 2020 Cachefiles: fs-cache backend for caching on mounted filesystems

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs/cachefiles: Drop superfluous readpages aops NULL check

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.

---
 fs/cachefiles/rdwr.c | 2 --
 1 file changed, 2 deletions(-)
fs/cachefiles/rdwr.c +0 -2
index 3080cda9e824..5b4cee71fa32 100644
@@ -412,7 +412,6 @@ int cachefiles_read_or_alloc_page(struct fscache_retrieval *op,
 
 	inode = d_backing_inode(object->backer);
 	ASSERT(S_ISREG(inode->i_mode));
-	ASSERT(inode->i_mapping->a_ops->readpages);
 
 	/* calculate the shift required to use bmap */
 	shift = PAGE_SHIFT - inode->i_sb->s_blocksize_bits;
@@ -712,7 +711,6 @@ int cachefiles_read_or_alloc_pages(struct fscache_retrieval *op,
 
 	inode = d_backing_inode(object->backer);
 	ASSERT(S_ISREG(inode->i_mode));
-	ASSERT(inode->i_mapping->a_ops->readpages);
 
 	/* calculate the shift required to use bmap */
 	shift = PAGE_SHIFT - inode->i_sb->s_blocksize_bits;
Signature · 1 line
2.16.4
#1 lore raw
Quoted 38 lines · Takashi Iwai

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.

---
 fs/cachefiles/rdwr.c | 2 --
 1 file changed, 2 deletions(-)
fs/cachefiles/rdwr.c +0 -3
index 3080cda9e824..5b4cee71fa32 100644
@@ -412,7 +412,6 @@ int cachefiles_read_or_alloc_page(struct fscache_retrieval *op,
 
        inode = d_backing_inode(object->backer);
        ASSERT(S_ISREG(inode->i_mode));
-       ASSERT(inode->i_mapping->a_ops->readpages);
 
        /* calculate the shift required to use bmap */
        shift = PAGE_SHIFT - inode->i_sb->s_blocksize_bits;
@@ -712,7 +711,6 @@ int cachefiles_read_or_alloc_pages(struct fscache_retrieval *op,
 
        inode = d_backing_inode(object->backer);
        ASSERT(S_ISREG(inode->i_mode));
-       ASSERT(inode->i_mapping->a_ops->readpages);
 
        /* calculate the shift required to use bmap */
        shift = PAGE_SHIFT - inode->i_sb->s_blocksize_bits;
--

2.16.4

Quoted 5 lines

--
Linux-cachefs mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-cachefs

Agree this should go in as fscache (I am testing with NFS) becomes unusable without it after 5.8.

It may have flown under the radar due to the in-progress FS-Cache rewrite.