public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfsdump: Remove dead code from restore_extent().
@ 2024-09-03 17:41 Bill O'Donnell
  2024-09-03 20:29 ` [External] : " mark.tinguely
  2024-09-10  8:06 ` Christoph Hellwig
  0 siblings, 2 replies; 3+ messages in thread
From: Bill O'Donnell @ 2024-09-03 17:41 UTC (permalink / raw)
  To: linux-xfs; +Cc: cem, djwong, sandeen, Bill O'Donnell

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


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

end of thread, other threads:[~2024-09-10  8:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-03 17:41 [PATCH] xfsdump: Remove dead code from restore_extent() Bill O'Donnell
2024-09-03 20:29 ` [External] : " mark.tinguely
2024-09-10  8:06 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox