xfsrestore: fix 2GB directory dump limitation for multi-stream

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The drive_simple restore path has a 2GB directory limit. Instead of
ASSERTing if nreadneeded64 is greater than INTGENMAX (2GB), add a loop
to handle it.

Signed-off-by: Rich Johnston <rjohnston@xxxxxxx>
---
 common/drive_simple.c |   24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

Index: b/common/drive_simple.c
===================================================================
--- a/common/drive_simple.c
+++ b/common/drive_simple.c
@@ -765,18 +765,20 @@ do_seek_mark( drive_t *drivep, drive_mar
 	/* use read_buf util func to eat up difference
 	 */
 	nreadneeded64 = mark - strmoff;
-	ASSERT( nreadneeded64 <= INTGENMAX );
-	nreadneeded = ( intgen_t )nreadneeded64;
-	nread = read_buf( 0,
-			  ( size_t )nreadneeded,
-			  ( void * )drivep,
-			  ( rfp_t )drivep->d_opsp->do_read,
-			  ( rrbfp_t )drivep->d_opsp->do_return_read_buf,
-			  &rval );
-	if  ( rval ) {
-		return rval;
+	while ( nreadneeded64 > 0 ) {
+		if ( nreadneeded64 > INTGENMAX )
+			nreadneeded = INTGENMAX;
+		else
+			nreadneeded = ( intgen_t )nreadneeded64;
+		nread = read_buf( 0, nreadneeded, drivep,
+				  ( rfp_t )drivep->d_opsp->do_read,
+				( rrbfp_t )drivep->d_opsp->do_return_read_buf,
+				  &rval );
+		if  ( rval ) {
+			return rval;
+		}
+		nreadneeded64 -= nread;
 	}
-	ASSERT( nread == nreadneeded );
 
 	/* verify we are on the mark
 	 */

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs



[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux