linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: missing trace_ext4_ext_map_blocks_exit after calling ext4_ext_handle_uninitialized_extents
@ 2012-10-16  7:31 Zheng Liu
  2012-11-08 19:50 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Zheng Liu @ 2012-10-16  7:31 UTC (permalink / raw)
  To: linux-ext4; +Cc: Zheng Liu

From: Zheng Liu <wenqing.lz@taobao.com>

When ext4_ext_handle_uninitialized_extents is called, we will directly return
from ext4_ext_map_blocks.  The trace point of trace_ext4_ext_map_blocks_exit
isn't called, and the user doesn't see any result.  This patch tries to fix this
problem.

Meanwhile in ext4_ext_handle_uninitialized_extents it returns errors or the
number of allocated blocks.  So 'ret' variable can be removed due to previously
modifications.

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
---
 fs/ext4/extents.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 1c94cca..dc7ef4c 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3876,7 +3876,7 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
 	struct ext4_extent newex, *ex, *ex2;
 	struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
 	ext4_fsblk_t newblock = 0;
-	int free_on_err = 0, err = 0, depth, ret;
+	int free_on_err = 0, err = 0, depth;
 	unsigned int allocated = 0, offset = 0;
 	unsigned int allocated_clusters = 0;
 	struct ext4_allocation_request ar;
@@ -3972,10 +3972,10 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
 					ee_len, ee_start);
 				goto out;
 			}
-			ret = ext4_ext_handle_uninitialized_extents(
+			allocated = ext4_ext_handle_uninitialized_extents(
 				handle, inode, map, path, flags,
 				allocated, newblock);
-			return ret;
+			goto out3;
 		}
 	}
 
@@ -4249,6 +4249,7 @@ out2:
 		kfree(path);
 	}
 
+out3:
 	trace_ext4_ext_map_blocks_exit(inode, map->m_lblk,
 		newblock, map->m_len, err ? err : allocated);
 
-- 
1.7.12.rc2.18.g61b472e


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

* Re: [PATCH] ext4: missing trace_ext4_ext_map_blocks_exit after calling ext4_ext_handle_uninitialized_extents
  2012-10-16  7:31 [PATCH] ext4: missing trace_ext4_ext_map_blocks_exit after calling ext4_ext_handle_uninitialized_extents Zheng Liu
@ 2012-11-08 19:50 ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2012-11-08 19:50 UTC (permalink / raw)
  To: Zheng Liu; +Cc: linux-ext4, Zheng Liu

On Tue, Oct 16, 2012 at 03:31:36PM +0800, Zheng Liu wrote:
> From: Zheng Liu <wenqing.lz@taobao.com>
> 
> When ext4_ext_handle_uninitialized_extents is called, we will directly return
> from ext4_ext_map_blocks.  The trace point of trace_ext4_ext_map_blocks_exit
> isn't called, and the user doesn't see any result.  This patch tries to fix this
> problem.
> 
> Meanwhile in ext4_ext_handle_uninitialized_extents it returns errors or the
> number of allocated blocks.  So 'ret' variable can be removed due to previously
> modifications.
> 
> Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>

Applied, thanks.

					- Ted

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

end of thread, other threads:[~2012-11-08 22:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-16  7:31 [PATCH] ext4: missing trace_ext4_ext_map_blocks_exit after calling ext4_ext_handle_uninitialized_extents Zheng Liu
2012-11-08 19:50 ` Theodore Ts'o

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).