Package: dcfldd
Version: 1.3.4.1-2.1
Severity: normal
Tags: patch

Dear Maintainer,

Probing the size of large block devices fails, because
ioctl(..., BLKGETSIZE, ...) fails with -EFBIG.

The following patch makes dcfldd use BLKGETSIZE64
on Linux:

--- dcfldd-1.3.4.1.orig/sizeprobe.c
+++ dcfldd-1.3.4.1/sizeprobe.c
@@ -63,9 +63,13 @@ static off_t midpoint(off_t a, off_t b,
 static off_t get_dev_size(int fd, long blksize) 
 {
     off_t num_sectors = 0;
-  
-    if (ioctl(fd, BLKGETSIZE, &num_sectors))
-        log_info("%s: ioctl call to BLKGETSIZE failed.\n", program_name);
+ 
+    /*
+     * Use BLKGETSIZE64 unconditionally, since dcfldd.h #defines 
_FILE_OFFSET_BITS 64
+     * and off_t is guaranteed to be large enough to hold the result.
+     */
+    if (ioctl(fd, BLKGETSIZE64, &num_sectors))
+        log_info("%s: ioctl call to BLKGETSIZE64 failed.\n", program_name);
     else 
         return (num_sectors * 512);
 }

-- System Information:
Debian Release: 7.6
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/2 CPU cores)
Locale: LANG=el_GR.UTF8, LC_CTYPE=el_GR.UTF8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages dcfldd depends on:
ii  libc6  2.13-38+deb7u3

dcfldd recommends no packages.

dcfldd suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to