public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Bill O'Donnell <bodonnel@redhat.com>
To: linux-xfs@vger.kernel.org
Cc: cem@kernel.org, djwong@kernel.org, sandeen@sandeen.net,
	Bill O'Donnell <bodonnel@redhat.com>
Subject: [PATCH] xfsdump: Remove dead code from restore_extent().
Date: Tue,  3 Sep 2024 12:41:41 -0500	[thread overview]
Message-ID: <20240903174140.268614-2-bodonnel@redhat.com> (raw)

Remove dead code and from restore_extent() in content.c.
Variable rttrunc is constantly 0.

Coverity CID 1618877

Signed-off-by: Bill O'Donnell <bodonnel@redhat.com>
---
 restore/content.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/restore/content.c b/restore/content.c
index 7ec3a4d..20f9dbf 100644
--- a/restore/content.c
+++ b/restore/content.c
@@ -8495,7 +8495,6 @@ restore_extent(filehdr_t *fhdrp,
 				      tries++,
 				      remaining -= (size_t)rval,
 				      tmp_off += (off64_t)rval) {
-					int rttrunc = 0;
 					int trycnt = 0;
 					assert(remaining
 						<=
@@ -8535,12 +8534,6 @@ restore_extent(filehdr_t *fhdrp,
 						      tmp_off,
 						      rval);
 					}
-					if (rttrunc) {
-						/* truncate and re-set rval */
-						if (rval == remaining)
-							rval = rttrunc;
-						ftruncate(fd, bstatp->bs_size);
-					}
 				}
 			} else {
 				nwritten = (int)ntowrite;
-- 
2.46.0


             reply	other threads:[~2024-09-03 17:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-03 17:41 Bill O'Donnell [this message]
2024-09-03 20:29 ` [External] : [PATCH] xfsdump: Remove dead code from restore_extent() mark.tinguely
2024-09-10  8:06 ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240903174140.268614-2-bodonnel@redhat.com \
    --to=bodonnel@redhat.com \
    --cc=cem@kernel.org \
    --cc=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox