linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4:memset is needless in ext4_ext_remove_space()
@ 2010-11-08  1:19 "潘卫平(Peter Pan)"
  2010-11-08  4:37 ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: "潘卫平(Peter Pan)" @ 2010-11-08  1:19 UTC (permalink / raw)
  To: tytso, adilger.kernel; +Cc: linux-ext4, kernel-janitors, linux-kernel


memset is needless because path is allocated by kzalloc.

Signed-off-by: Peter Pan(潘卫平) <wppan@redflag-linux.com>
---
  fs/ext4/extents.c |    1 -
  1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 0554c48..37cdb6e 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -2375,7 +2375,6 @@ again:
  			/* go to the next level */
  			ext_debug("move to level %d (block %llu)\n",
  				  i + 1, ext4_idx_pblock(path[i].p_idx));
-			memset(path + i + 1, 0, sizeof(*path));
  			bh = sb_bread(sb, ext4_idx_pblock(path[i].p_idx));
  			if (!bh) {
  				/* should we reset i_size? */
-- 
1.6.6



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

* Re: [PATCH] ext4:memset is needless in ext4_ext_remove_space()
  2010-11-08  1:19 [PATCH] ext4:memset is needless in ext4_ext_remove_space() "潘卫平(Peter Pan)"
@ 2010-11-08  4:37 ` Dan Carpenter
  2010-11-08  6:24   ` "Peter Pan(潘卫平)"
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2010-11-08  4:37 UTC (permalink / raw)
  To: 潘卫平(Peter Pan)
  Cc: tytso, adilger.kernel, linux-ext4, kernel-janitors, linux-kernel

On Mon, Nov 08, 2010 at 09:19:47AM +0800, "潘卫平(Peter Pan)" wrote:
>
> memset is needless because path is allocated by kzalloc.
>

This is inside a loop and sometimes we do i++ and sometimes i--.  Are
you absolutely positive that path + i isn't initialized?

I haven't followed this code through all the way but my instinct is
that the memset is there for a reason.

regards,
dan carpenter



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

* Re: [PATCH] ext4:memset is needless in ext4_ext_remove_space()
  2010-11-08  4:37 ` Dan Carpenter
@ 2010-11-08  6:24   ` "Peter Pan(潘卫平)"
  0 siblings, 0 replies; 3+ messages in thread
From: "Peter Pan(潘卫平)" @ 2010-11-08  6:24 UTC (permalink / raw)
  To: Dan Carpenter, "潘卫平(Peter Pan)",
	tytso, adilger.kernel, linux-ext4, kernel-janitors, linux-kernel

On 2010年11月08日 12:37, Dan Carpenter wrote:
> This is inside a loop and sometimes we do i++ and sometimes i--. Are
> you absolutely positive that path + i isn't initialized?
>
> I haven't followed this code through all the way but my instinct is
> that the memset is there for a reason.
>    
I know that I misunderstood it.

Thank you!

Regards

Peter Pan

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

end of thread, other threads:[~2010-11-08  6:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-08  1:19 [PATCH] ext4:memset is needless in ext4_ext_remove_space() "潘卫平(Peter Pan)"
2010-11-08  4:37 ` Dan Carpenter
2010-11-08  6:24   ` "Peter Pan(潘卫平)"

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