From 274315957221e81be28fd0c2265dc553207f9a3b Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 25 Jul 2005 11:36:43 -0500 Subject: [PATCH] Fix false positives from valgrind: memcpy via no-op structure copy 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" --- e2fsck/ChangeLog | 6 ++++++ e2fsck/pass1.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 726d63b..53cbbb0 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,3 +1,9 @@ +2005-07-25 Theodore Ts'o + + * 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 * problem.c: Remove period from the Pass 1C header, to be diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index 4595cbc..605a9ea 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -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; } -- 1.8.3.1