Bug 26822 - Benchmarking fails with "Error seeking to position-1836040192 for (null): Invalid argument"
Summary: Benchmarking fails with "Error seeking to position-1836040192 for (null): Inv...
Status: RESOLVED FIXED
Alias: None
Product: udisks
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium normal
Assignee: David Zeuthen (not reading bugmail)
QA Contact:
URL: https://bugs.launchpad.net/ubuntu/+so...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-01 10:14 UTC by Daniele Napolitano
Modified: 2010-03-02 08:53 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Patch for bug #26822 (1.08 KB, patch)
2010-03-01 11:49 UTC, Daniele Napolitano
Details | Splinter Review

Description Daniele Napolitano 2010-03-01 10:14:45 UTC
Distro: Ubuntu 9.10 (+ some 10.04 packages)
Kernel: 2.6.32-14-generic
UDisks package version: 1.0.0~git20100223.a38230-2ubuntu1

When I try to benchmark my hard disk, it fail.

This is the manual udisk command:

$ sudo /usr/lib/udisks/udisks-helper-drive-benchmark /dev/sda 0
udisks-helper-progress: 0.0
read_transfer_rate: offset 0 rate 50121963.552517
udisks-helper-progress: 0.000000
read_transfer_rate: offset 409821184 rate 50161531.921785
read_transfer_rate: offset 819642368 rate 50068291.105993
read_transfer_rate: offset 1229463552 rate 50186590.338347
read_transfer_rate: offset 1639284736 rate 50145967.676659
read_transfer_rate: offset 2049105920 rate 50103384.598795
Error seeking to position -1836040192 for (null): Invalid argument

$ sudo fdisk -l
Disk /dev/sda: 82.0 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical / optimal IO): 512 bytes / 512 bytes
Disk identifier: 0x92899289
[...]

$ sudo hdparm -I /dev/sda

/dev/sda:

ATA device, with non-removable media
 Model Number: Maxtor 6Y080L0
 Serial Number: Y3JNVAEE
 Firmware Revision: YAR41VW0
Standards:
 Used: ATA/ATAPI-7 T13 1532D revision 0
 Supported: 7 6 5 4
Configuration:
 Logical max current
 cylinders 16383 16383
 heads 16 16
 sectors/track 63 63
 --
 CHS current addressable sectors: 16514064
 LBA user addressable sectors: 160086528
 LBA48 user addressable sectors: 160086528
 Logical/Physical Sector size: 512 bytes
 device size with M = 1024*1024: 78167 MBytes
 device size with M = 1000*1000: 81964 MBytes (81 GB)
 cache/buffer size = 2048 KBytes (type=DualPortCache)
[...]

Benchmark only work with USB sticks. All USB sticks that I have it's OK.

Benchmark fail with every other HD that I have.
Comment 1 Daniele Napolitano 2010-03-01 10:58:45 UTC
The problem seems to be here:

src/helpers/job-drive-benchmark.c

line 175: pos &= ~(page_size - 1);

This operation make "pos" negative, before this line "pos" is positive.
Comment 2 Daniele Napolitano 2010-03-01 11:49:39 UTC
Created attachment 33666 [details] [review]
Patch for bug #26822

This patch solve my bug.

Use lseek64() instead lseek().
Comment 3 Martin Pitt 2010-03-01 23:17:38 UTC
Thanks for this!

I grepped the source, and confirm that job-drive-benchmark.c is the last place which still uses lseek(), the others are already using the 64 bit variant.
Comment 5 David Zeuthen (not reading bugmail) 2010-03-02 08:53:22 UTC
Cool - that explains why benchmarking didn't work on my 32-bit box (I mainly use 64-bit boxes these days). Thanks!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.