diff mbox series

xfsdump: Remove dead code from restore_extent().

Message ID 20240903174140.268614-2-bodonnel@redhat.com (mailing list archive)
State Not Applicable, archived
Headers show
Series xfsdump: Remove dead code from restore_extent(). | expand

Commit Message

Bill O'Donnell Sept. 3, 2024, 5:41 p.m. UTC
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(-)

Comments

mark.tinguely@oracle.com Sept. 3, 2024, 8:29 p.m. UTC | #1
On 9/3/24 12:41 PM, Bill O'Donnell wrote:
> 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(-)
>
Looks like dead code.

Reviewed-by: Mark Tinguely <mark.tinguely@oracle.com>
Christoph Hellwig Sept. 10, 2024, 8:06 a.m. UTC | #2
Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

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;