]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
Fix false positives from valgrind: memcpy via no-op structure copy
authorTheodore Ts'o <tytso@mit.edu>
Mon, 25 Jul 2005 16:36:43 +0000 (11:36 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 25 Jul 2005 16:36:43 +0000 (11:36 -0500)
Don't do a structure copy via an assignment in e2fsck's pass #1 when
it is a no-op in order to avoid false positives from valgrind.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
e2fsck/ChangeLog
e2fsck/pass1.c

index 726d63bc94608700ea7531718eaa7738959fa006..53cbbb0501e00c595ba2f57546b952ccf9b82e0e 100644 (file)
@@ -1,3 +1,9 @@
+2005-07-25  Theodore Ts'o  <tytso@mit.edu>
+
+       * pass1.c (pass1_write_inode): Fix false positive from valgrind;
+               don't do a needless structure copy via an assignment when
+               it is a no-op.
+
 2005-07-04  Theodore Ts'o  <tytso@mit.edu>
 
        * problem.c: Remove period from the Pass 1C header, to be
index 4595cbcf878bdf67e7c4bc16bc4b654ad007186b..605a9eaa8fc58b639593594779a41a1c553f0b99 100644 (file)
@@ -2089,7 +2089,8 @@ static errcode_t pass1_write_inode(ext2_filsys fs, ext2_ino_t ino,
 {
        e2fsck_t ctx = (e2fsck_t) fs->priv_data;
 
-       if ((ino == ctx->stashed_ino) && ctx->stashed_inode)
+       if ((ino == ctx->stashed_ino) && ctx->stashed_inode &&
+               (inode != ctx->stashed_inode))
                *ctx->stashed_inode = *inode;
        return EXT2_ET_CALLBACK_NOTHANDLED;
 }