Skip to contentSkip to conversation

ocfs2: Add the trace_ocfs2_read_blocks_end

PATCH New Zhang Qilong 2 participants 3 messages Oct 16, 2020 – Oct 19, 2020 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ocfs2: Add the trace_ocfs2_read_blocks_end

Missing the trace_ocfs2_read_blocks_end when reading blocks fails.

---
 fs/ocfs2/buffer_head_io.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/ocfs2/buffer_head_io.c +1 -2
index f0b104e483d8..0e6ee6e9b201 100644
@@ -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;
 }
 
Signature · 1 line
2.17.1
maintainer
#1 lore raw

PATCH 1/1 ocfs2: Add the trace_ocfs2_read_blocks_end

Quoted 1 line · Zhang Qilong

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

Quoted 23 lines
---
 fs/ocfs2/buffer_head_io.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/ocfs2/buffer_head_io.c +1 -2
index f0b104e483d8..0e6ee6e9b201 100644
@@ -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;
 }
 
#2 lore raw

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

Quoted 42 lines

-----????-----
???: Joseph Qi [mailto:joseph.qi at linux.alibaba.com] ????: 2020?10?19? 15:46
???: zhangqilong <[email protected]>; mark at fasheh.com; jlbec at evilplan.org
??: ocfs2-devel at oss.oracle.com
??: Re: [patch -next] ocfs2: Add the trace_ocfs2_read_blocks_end

Quoted 1 line · Zhang Qilong

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

fs/ocfs2/buffer_head_io.c int ocfs2_read_blocks(struct ocfs2_caching_info

Quoted 10 lines
---
 fs/ocfs2/buffer_head_io.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/ocfs2/buffer_head_io.c +0 -0
index f0b104e483d8..0e6ee6e9b201 100644
@@ -395,11 +395,10 @@ int ocfs2_read_blocks(struct ocfs2_caching_info

*ci, u64 block, int nr,

Quoted 13 lines
fs/ocfs2/buffer_head_io.c +1 -2
 	}
 	ocfs2_metadata_cache_io_unlock(ci);
 
+bail:
 	trace_ocfs2_read_blocks_end((unsigned long long)block, nr,
 				    flags, ignore_cache);
 
-bail:
-
 	return status;
 }