linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs/cachefiles: Drop superfluous readpages aops NULL check
@ 2020-08-27 14:27 Takashi Iwai
  2020-10-14 13:48 ` [Linux-cachefs] " David Wysochanski
  0 siblings, 1 reply; 2+ messages in thread
From: Takashi Iwai @ 2020-08-27 14:27 UTC (permalink / raw)
  To: David Howells; +Cc: linux-cachefs, linux-kernel

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.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=208883
BugLink: https://bugzilla.opensuse.org/show_bug.cgi?id=1175245
Cc: <stable@vger.kernel.org> # v5.8
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 fs/cachefiles/rdwr.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/cachefiles/rdwr.c b/fs/cachefiles/rdwr.c
index 3080cda9e824..5b4cee71fa32 100644
--- a/fs/cachefiles/rdwr.c
+++ b/fs/cachefiles/rdwr.c
@@ -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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Linux-cachefs] [PATCH] fs/cachefiles: Drop superfluous readpages aops NULL check
  2020-08-27 14:27 [PATCH] fs/cachefiles: Drop superfluous readpages aops NULL check Takashi Iwai
@ 2020-10-14 13:48 ` David Wysochanski
  0 siblings, 0 replies; 2+ messages in thread
From: David Wysochanski @ 2020-10-14 13:48 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: David Howells, linux-cachefs, Linux Kernel Mailing List

On Thu, Aug 27, 2020 at 11:10 AM Takashi Iwai <tiwai@suse.de> wrote:
>
> 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.
>
> BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=208883
> BugLink: https://bugzilla.opensuse.org/show_bug.cgi?id=1175245
> Cc: <stable@vger.kernel.org> # v5.8
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> ---
>  fs/cachefiles/rdwr.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/fs/cachefiles/rdwr.c b/fs/cachefiles/rdwr.c
> index 3080cda9e824..5b4cee71fa32 100644
> --- a/fs/cachefiles/rdwr.c
> +++ b/fs/cachefiles/rdwr.c
> @@ -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
>
> --
> Linux-cachefs mailing list
> Linux-cachefs@redhat.com
> 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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-14 13:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-27 14:27 [PATCH] fs/cachefiles: Drop superfluous readpages aops NULL check Takashi Iwai
2020-10-14 13:48 ` [Linux-cachefs] " David Wysochanski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).