Fix serious file-corruption issue on sparable partitions.

This commit is contained in:
reinoud 2006-09-19 22:00:38 +00:00
parent 6a80f03f7b
commit 4911612931
1 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: udf_subr.c,v 1.16 2006/09/19 15:34:23 reinoud Exp $ */ /* $NetBSD: udf_subr.c,v 1.17 2006/09/19 22:00:38 reinoud Exp $ */
/* /*
* Copyright (c) 2006 Reinoud Zandijk * Copyright (c) 2006 Reinoud Zandijk
@ -36,7 +36,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: udf_subr.c,v 1.16 2006/09/19 15:34:23 reinoud Exp $"); __RCSID("$NetBSD: udf_subr.c,v 1.17 2006/09/19 22:00:38 reinoud Exp $");
#endif /* not lint */ #endif /* not lint */
@ -2825,6 +2825,7 @@ udf_translate_file_extent(struct udf_node *node,
translen = overlap; translen = overlap;
while (overlap && pages && translen) { while (overlap && pages && translen) {
*map++ = transsec; *map++ = transsec;
lb_num++;
overlap--; pages--; translen--; overlap--; pages--; translen--;
} }
break; break;
@ -2838,7 +2839,7 @@ udf_translate_file_extent(struct udf_node *node,
return error; return error;
while (overlap && pages && translen) { while (overlap && pages && translen) {
*map++ = transsec; *map++ = transsec;
transsec++; lb_num++; transsec++;
overlap--; pages--; translen--; overlap--; pages--; translen--;
} }
break; break;