All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] erofs: fix crash when enable tracepoint cachefiles_prep_read
@ 2022-05-27 10:18 Xin Yin
  2022-05-27 12:01 ` JeffleXu
  2022-05-29  6:08 ` Chao Yu
  0 siblings, 2 replies; 4+ messages in thread
From: Xin Yin @ 2022-05-27 10:18 UTC (permalink / raw)
  To: hsiangkao, chao, jefflexu; +Cc: linux-erofs, Xin Yin

RIP: 0010:trace_event_raw_event_cachefiles_prep_read+0x88/0xe0
[cachefiles]
Call Trace:
  <TASK>
  cachefiles_prepare_read+0x1d7/0x3a0 [cachefiles]
  erofs_fscache_read_folios+0x188/0x220 [erofs]
  erofs_fscache_meta_readpage+0x106/0x160 [erofs]
  do_read_cache_folio+0x42a/0x590
  ? bdi_register_va.part.14+0x1a7/0x210
  ? super_setup_bdi_name+0x76/0xe0
  erofs_bread+0x5b/0x170 [erofs]
  erofs_fc_fill_super+0x12b/0xc50 [erofs]

This tracepoint uses rreq->inode, should set it when allocating.

Fixes: d435d53228dd ("erofs: change to use asynchronous io for fscache
readpage/readahead")
Signed-off-by: Xin Yin <yinxin.x@bytedance.com>
---
 fs/erofs/fscache.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/erofs/fscache.c b/fs/erofs/fscache.c
index a5cc4ed2cd0d..8e01d89c3319 100644
--- a/fs/erofs/fscache.c
+++ b/fs/erofs/fscache.c
@@ -17,6 +17,7 @@ static struct netfs_io_request *erofs_fscache_alloc_request(struct address_space
 	rreq->start	= start;
 	rreq->len	= len;
 	rreq->mapping	= mapping;
+	rreq->inode	= mapping->host;
 	INIT_LIST_HEAD(&rreq->subrequests);
 	refcount_set(&rreq->ref, 1);
 	return rreq;
-- 
2.25.1


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

* Re: [PATCH] erofs: fix crash when enable tracepoint cachefiles_prep_read
  2022-05-27 10:18 [PATCH] erofs: fix crash when enable tracepoint cachefiles_prep_read Xin Yin
@ 2022-05-27 12:01 ` JeffleXu
  2022-05-28 13:54   ` Gao Xiang
  2022-05-29  6:08 ` Chao Yu
  1 sibling, 1 reply; 4+ messages in thread
From: JeffleXu @ 2022-05-27 12:01 UTC (permalink / raw)
  To: Xin Yin, hsiangkao, chao; +Cc: linux-erofs

Hi, thanks for catching this.


On 5/27/22 6:18 PM, Xin Yin wrote:
> RIP: 0010:trace_event_raw_event_cachefiles_prep_read+0x88/0xe0
> [cachefiles]
> Call Trace:
>   <TASK>
>   cachefiles_prepare_read+0x1d7/0x3a0 [cachefiles]
>   erofs_fscache_read_folios+0x188/0x220 [erofs]
>   erofs_fscache_meta_readpage+0x106/0x160 [erofs]
>   do_read_cache_folio+0x42a/0x590
>   ? bdi_register_va.part.14+0x1a7/0x210
>   ? super_setup_bdi_name+0x76/0xe0
>   erofs_bread+0x5b/0x170 [erofs]
>   erofs_fc_fill_super+0x12b/0xc50 [erofs]
> 
> This tracepoint uses rreq->inode, should set it when allocating.
> 
> Fixes: d435d53228dd ("erofs: change to use asynchronous io for fscache
> readpage/readahead")

The "Fixes" line should better be one single line. But no worry, I think
Gao Xiang will fix this then :)

> Signed-off-by: Xin Yin <yinxin.x@bytedance.com>
> ---
>  fs/erofs/fscache.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/erofs/fscache.c b/fs/erofs/fscache.c
> index a5cc4ed2cd0d..8e01d89c3319 100644
> --- a/fs/erofs/fscache.c
> +++ b/fs/erofs/fscache.c
> @@ -17,6 +17,7 @@ static struct netfs_io_request *erofs_fscache_alloc_request(struct address_space
>  	rreq->start	= start;
>  	rreq->len	= len;
>  	rreq->mapping	= mapping;
> +	rreq->inode	= mapping->host;
>  	INIT_LIST_HEAD(&rreq->subrequests);
>  	refcount_set(&rreq->ref, 1);
>  	return rreq;

Otherwise, LGTM.

Reviewed-by: Jeffle Xu <jefflexu@linux.alibaba.com>

-- 
Thanks,
Jeffle

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

* Re: [PATCH] erofs: fix crash when enable tracepoint cachefiles_prep_read
  2022-05-27 12:01 ` JeffleXu
@ 2022-05-28 13:54   ` Gao Xiang
  0 siblings, 0 replies; 4+ messages in thread
From: Gao Xiang @ 2022-05-28 13:54 UTC (permalink / raw)
  To: JeffleXu; +Cc: hsiangkao, linux-erofs, Xin Yin

On Fri, May 27, 2022 at 08:01:14PM +0800, JeffleXu wrote:
> Hi, thanks for catching this.
> 
> 
> On 5/27/22 6:18 PM, Xin Yin wrote:
> > RIP: 0010:trace_event_raw_event_cachefiles_prep_read+0x88/0xe0
> > [cachefiles]
> > Call Trace:
> >   <TASK>
> >   cachefiles_prepare_read+0x1d7/0x3a0 [cachefiles]
> >   erofs_fscache_read_folios+0x188/0x220 [erofs]
> >   erofs_fscache_meta_readpage+0x106/0x160 [erofs]
> >   do_read_cache_folio+0x42a/0x590
> >   ? bdi_register_va.part.14+0x1a7/0x210
> >   ? super_setup_bdi_name+0x76/0xe0
> >   erofs_bread+0x5b/0x170 [erofs]
> >   erofs_fc_fill_super+0x12b/0xc50 [erofs]
> > 
> > This tracepoint uses rreq->inode, should set it when allocating.
> > 
> > Fixes: d435d53228dd ("erofs: change to use asynchronous io for fscache
> > readpage/readahead")
> 
> The "Fixes" line should better be one single line. But no worry, I think
> Gao Xiang will fix this then :)

Yeah,

> 
> > Signed-off-by: Xin Yin <yinxin.x@bytedance.com>
> > ---
> >  fs/erofs/fscache.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/fs/erofs/fscache.c b/fs/erofs/fscache.c
> > index a5cc4ed2cd0d..8e01d89c3319 100644
> > --- a/fs/erofs/fscache.c
> > +++ b/fs/erofs/fscache.c
> > @@ -17,6 +17,7 @@ static struct netfs_io_request *erofs_fscache_alloc_request(struct address_space
> >  	rreq->start	= start;
> >  	rreq->len	= len;
> >  	rreq->mapping	= mapping;
> > +	rreq->inode	= mapping->host;
> >  	INIT_LIST_HEAD(&rreq->subrequests);
> >  	refcount_set(&rreq->ref, 1);
> >  	return rreq;
> 
> Otherwise, LGTM.
> 
> Reviewed-by: Jeffle Xu <jefflexu@linux.alibaba.com>
> 

Thanks, applied.

Thanks,
Gao Xiang

> -- 
> Thanks,
> Jeffle

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

* Re: [PATCH] erofs: fix crash when enable tracepoint cachefiles_prep_read
  2022-05-27 10:18 [PATCH] erofs: fix crash when enable tracepoint cachefiles_prep_read Xin Yin
  2022-05-27 12:01 ` JeffleXu
@ 2022-05-29  6:08 ` Chao Yu
  1 sibling, 0 replies; 4+ messages in thread
From: Chao Yu @ 2022-05-29  6:08 UTC (permalink / raw)
  To: Xin Yin, hsiangkao, jefflexu; +Cc: linux-erofs

On 2022/5/27 18:18, Xin Yin wrote:
> RIP: 0010:trace_event_raw_event_cachefiles_prep_read+0x88/0xe0
> [cachefiles]
> Call Trace:
>    <TASK>
>    cachefiles_prepare_read+0x1d7/0x3a0 [cachefiles]
>    erofs_fscache_read_folios+0x188/0x220 [erofs]
>    erofs_fscache_meta_readpage+0x106/0x160 [erofs]
>    do_read_cache_folio+0x42a/0x590
>    ? bdi_register_va.part.14+0x1a7/0x210
>    ? super_setup_bdi_name+0x76/0xe0
>    erofs_bread+0x5b/0x170 [erofs]
>    erofs_fc_fill_super+0x12b/0xc50 [erofs]
> 
> This tracepoint uses rreq->inode, should set it when allocating.
> 
> Fixes: d435d53228dd ("erofs: change to use asynchronous io for fscache
> readpage/readahead")

Should not wrap long 'fixes' line.

> Signed-off-by: Xin Yin <yinxin.x@bytedance.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,

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

end of thread, other threads:[~2022-05-29  6:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-27 10:18 [PATCH] erofs: fix crash when enable tracepoint cachefiles_prep_read Xin Yin
2022-05-27 12:01 ` JeffleXu
2022-05-28 13:54   ` Gao Xiang
2022-05-29  6:08 ` Chao Yu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.