diff mbox series

[-next] ocfs2: Add the trace_ocfs2_read_blocks_end

Message ID 20201016091157.29039-1-zhangqilong3@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] ocfs2: Add the trace_ocfs2_read_blocks_end | expand

Commit Message

Zhang Qilong Oct. 16, 2020, 9:11 a.m. UTC
Missing the trace_ocfs2_read_blocks_end when reading blocks fails.

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
---
 fs/ocfs2/buffer_head_io.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Joseph Qi Oct. 19, 2020, 7:46 a.m. UTC | #1
On 2020/10/16 17:11, Zhang Qilong wrote:
> Missing the trace_ocfs2_read_blocks_end when reading blocks fails.>
Why do you need the trace in case error?
In general, it will log an error message if fail.

Thanks,
Joseph

> Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
> ---
>  fs/ocfs2/buffer_head_io.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/ocfs2/buffer_head_io.c b/fs/ocfs2/buffer_head_io.c
> index f0b104e483d8..0e6ee6e9b201 100644
> --- a/fs/ocfs2/buffer_head_io.c
> +++ b/fs/ocfs2/buffer_head_io.c
> @@ -395,11 +395,10 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,
>  	}
>  	ocfs2_metadata_cache_io_unlock(ci);
>  
> +bail:
>  	trace_ocfs2_read_blocks_end((unsigned long long)block, nr,
>  				    flags, ignore_cache);
>  
> -bail:
> -
>  	return status;
>  }
>  
>
Zhang Qilong Oct. 19, 2020, 8:07 a.m. UTC | #2
Hi, Joseph

I think it makes sense, the 'begin' trace entry will always be paired 
with 'end'. For the post processing the trace, it would be easier to 
reconstruct such reading block operation and mark immediately as 'not sent' (avoiding 
to bother about entries which only have 'begin'). Logging an error message could help 
locate problems quickly in case error.
It looks good to me, so feel free to add it.

Best wish, thanks,
Zhang Qilong

> -----邮件原件-----
> 发件人: Joseph Qi [mailto:joseph.qi@linux.alibaba.com]
> 发送时间: 2020年10月19日 15:46
> 收件人: zhangqilong <zhangqilong3@huawei.com>; mark@fasheh.com;
> jlbec@evilplan.org
> 抄送: ocfs2-devel@oss.oracle.com
> 主题: Re: [patch -next] ocfs2: Add the trace_ocfs2_read_blocks_end
> 
> 
> 
> On 2020/10/16 17:11, Zhang Qilong wrote:
> > Missing the trace_ocfs2_read_blocks_end when reading blocks fails.>
> Why do you need the trace in case error?
> In general, it will log an error message if fail.
> 
> Thanks,
> Joseph
> 
> > Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
> > ---
> >  fs/ocfs2/buffer_head_io.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/fs/ocfs2/buffer_head_io.c b/fs/ocfs2/buffer_head_io.c
> > index f0b104e483d8..0e6ee6e9b201 100644
> > --- a/fs/ocfs2/buffer_head_io.c
> > +++ b/fs/ocfs2/buffer_head_io.c
> > @@ -395,11 +395,10 @@ int ocfs2_read_blocks(struct ocfs2_caching_info
> *ci, u64 block, int nr,
> >  	}
> >  	ocfs2_metadata_cache_io_unlock(ci);
> >
> > +bail:
> >  	trace_ocfs2_read_blocks_end((unsigned long long)block, nr,
> >  				    flags, ignore_cache);
> >
> > -bail:
> > -
> >  	return status;
> >  }
> >
> >
diff mbox series

Patch

diff --git a/fs/ocfs2/buffer_head_io.c b/fs/ocfs2/buffer_head_io.c
index f0b104e483d8..0e6ee6e9b201 100644
--- a/fs/ocfs2/buffer_head_io.c
+++ b/fs/ocfs2/buffer_head_io.c
@@ -395,11 +395,10 @@  int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,
 	}
 	ocfs2_metadata_cache_io_unlock(ci);
 
+bail:
 	trace_ocfs2_read_blocks_end((unsigned long long)block, nr,
 				    flags, ignore_cache);
 
-bail:
-
 	return status;
 }