* [PATCH] cachefiles: Drop superfluous readpages aops NULL check
@ 2020-10-19 14:56 David Howells
2020-10-19 15:05 ` Matthew Wilcox
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: David Howells @ 2020-10-19 14:56 UTC (permalink / raw)
To: torvalds
Cc: Takashi Iwai, Matthew Wilcox (Oracle),
dhowells, dwysocha, linux-afs, linux-fsdevel, linux-kernel
From: Takashi Iwai <tiwai@suse.de>
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: 9ae326a69004 ("CacheFiles: A cache that backs onto a mounted filesystem")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Matthew Wilcox (Oracle) <willy@infradead.org>
---
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;
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] cachefiles: Drop superfluous readpages aops NULL check
2020-10-19 14:56 [PATCH] cachefiles: Drop superfluous readpages aops NULL check David Howells
@ 2020-10-19 15:05 ` Matthew Wilcox
2020-10-20 7:53 ` Christoph Hellwig
2021-01-20 16:12 ` David Howells
2 siblings, 0 replies; 6+ messages in thread
From: Matthew Wilcox @ 2020-10-19 15:05 UTC (permalink / raw)
To: David Howells
Cc: torvalds, Takashi Iwai, dwysocha, linux-afs, linux-fsdevel, linux-kernel
On Mon, Oct 19, 2020 at 03:56:54PM +0100, David Howells wrote:
> From: Takashi Iwai <tiwai@suse.de>
>
> 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: 9ae326a69004 ("CacheFiles: A cache that backs onto a mounted filesystem")
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> Signed-off-by: David Howells <dhowells@redhat.com>
> cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Matthew Wilcox (Oracle) <willy@infradead.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] cachefiles: Drop superfluous readpages aops NULL check
2020-10-19 14:56 [PATCH] cachefiles: Drop superfluous readpages aops NULL check David Howells
2020-10-19 15:05 ` Matthew Wilcox
@ 2020-10-20 7:53 ` Christoph Hellwig
2020-10-20 11:06 ` Matthew Wilcox
2021-01-20 16:12 ` David Howells
2 siblings, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2020-10-20 7:53 UTC (permalink / raw)
To: David Howells
Cc: torvalds, Takashi Iwai, dwysocha, linux-kernel,
Matthew Wilcox (Oracle),
linux-fsdevel, linux-afs
Hmm,
what prevents us from killing of the last ->readpages instance?
Leaving half-finished API conversions in the tree usually doesn't end
well..
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] cachefiles: Drop superfluous readpages aops NULL check
2020-10-20 7:53 ` Christoph Hellwig
@ 2020-10-20 11:06 ` Matthew Wilcox
0 siblings, 0 replies; 6+ messages in thread
From: Matthew Wilcox @ 2020-10-20 11:06 UTC (permalink / raw)
To: Christoph Hellwig
Cc: David Howells, torvalds, Takashi Iwai, dwysocha, linux-kernel,
linux-fsdevel, linux-afs
On Tue, Oct 20, 2020 at 08:53:07AM +0100, Christoph Hellwig wrote:
> Hmm,
>
> what prevents us from killing of the last ->readpages instance?
> Leaving half-finished API conversions in the tree usually doesn't end
> well..
Dave's working on it. Git tree:
https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=fscache-iter
(we've been collaborating and some of the prerequisites have trickled
into Linus' tree this merge window, eg the readahead changes)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] cachefiles: Drop superfluous readpages aops NULL check
2020-10-19 14:56 [PATCH] cachefiles: Drop superfluous readpages aops NULL check David Howells
2020-10-19 15:05 ` Matthew Wilcox
2020-10-20 7:53 ` Christoph Hellwig
@ 2021-01-20 16:12 ` David Howells
2 siblings, 0 replies; 6+ messages in thread
From: David Howells @ 2021-01-20 16:12 UTC (permalink / raw)
To: Christoph Hellwig
Cc: dhowells, Takashi Iwai, dwysocha, linux-kernel,
Matthew Wilcox (Oracle),
linux-fsdevel, torvalds, linux-afs
Christoph Hellwig <hch@infradead.org> wrote:
> what prevents us from killing of the last ->readpages instance?
> Leaving half-finished API conversions in the tree usually doesn't end
> well..
I never got around to making cachefiles actually use ->readpages, so that's
not an issue.
David
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] cachefiles: Drop superfluous readpages aops NULL check
@ 2021-01-20 16:11 David Howells
0 siblings, 0 replies; 6+ messages in thread
From: David Howells @ 2021-01-20 16:11 UTC (permalink / raw)
To: torvalds
Cc: Takashi Iwai, Matthew Wilcox (Oracle),
dhowells, linux-afs, linux-fsdevel, linux-kernel
From: Takashi Iwai <tiwai@suse.de>
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: 9ae326a69004 ("CacheFiles: A cache that backs onto a mounted filesystem")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
fs/cachefiles/rdwr.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/fs/cachefiles/rdwr.c b/fs/cachefiles/rdwr.c
index 8bda092e60c5..e027c718ca01 100644
--- a/fs/cachefiles/rdwr.c
+++ b/fs/cachefiles/rdwr.c
@@ -413,7 +413,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;
@@ -713,7 +712,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;
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-01-20 16:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-19 14:56 [PATCH] cachefiles: Drop superfluous readpages aops NULL check David Howells
2020-10-19 15:05 ` Matthew Wilcox
2020-10-20 7:53 ` Christoph Hellwig
2020-10-20 11:06 ` Matthew Wilcox
2021-01-20 16:12 ` David Howells
2021-01-20 16:11 David Howells
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).