Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Nov 2014 17:17:11 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r274634 - stable/10/usr.bin/mkimg
Message-ID:  <201411171717.sAHHHBFw067301@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Mon Nov 17 17:17:10 2014
New Revision: 274634
URL: https://svnweb.freebsd.org/changeset/base/274634

Log:
  MFC r274410: Fix for behaviour of SEEK_DATA on ZFS.

Modified:
  stable/10/usr.bin/mkimg/image.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.bin/mkimg/image.c
==============================================================================
--- stable/10/usr.bin/mkimg/image.c	Mon Nov 17 16:30:51 2014	(r274633)
+++ stable/10/usr.bin/mkimg/image.c	Mon Nov 17 17:17:10 2014	(r274634)
@@ -405,16 +405,18 @@ image_copyin_mapped(lba_t blk, int fd, u
 	error = 0;
 	while (!error && cur < end) {
 		hole = lseek(fd, cur, SEEK_HOLE);
+		if (hole == -1)
+			hole = end;
 		data = lseek(fd, cur, SEEK_DATA);
+		if (data == -1)
+			data = end;
 
 		/*
 		 * Treat the entire file as data if sparse files
 		 * are not supported by the underlying file system.
 		 */
-		if (hole == -1 && data == -1) {
+		if (hole == end && data == end)
 			data = cur;
-			hole = end;
-		}
 
 		if (cur == hole && data > hole) {
 			hole = pos;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411171717.sAHHHBFw067301>