Whamcloud - gitweb
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 726d63b..53cbbb0 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 4595cbc..605a9ea 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;
 }