Bug 12117 - Gpart fails to open large files (e.g. disk images)
Summary: Gpart fails to open large files (e.g. disk images)
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: gpart (show other bugs)
Version: unstable
Hardware: all Linux
: P2 minor
Assignee: Michael Shigorin
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-23 17:07 MSD by Konstantin Uvarin (lodin)
Modified: 2007-12-20 16:32 MSK (History)
2 users (show)

See Also:


Attachments
The patch that adds O_LARGEFILE (1.37 KB, patch)
2007-06-23 17:08 MSD, Konstantin Uvarin (lodin)
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Uvarin (lodin) 2007-06-23 17:07:55 MSD
When trying to open very large files (but not devices), gpart stops with "File 
too large" error messages.

replacing O_RDONLY with O_RDONLY|O_LARGEFILE and adding  -D_LARGEFILE64_SOURCE 
to the compile options seems to help.

So I'm attaching a patch, hoping it's useful.
Steps to Reproduce:
1. # dd if=/dev/sda of=somefile
    /dev/sda size >= several gig
2. # gpart -g somefile 

Actual Results:  
fails to open

Expected Results:  
gpart should work as if it was operating on a drive
Comment 1 Konstantin Uvarin (lodin) 2007-06-23 17:08:53 MSD
Created attachment 2031 [details]
The patch that adds O_LARGEFILE
Comment 2 Michael Shigorin 2007-06-23 20:46:59 MSD
let's assign it to myself
Comment 3 Michael Shigorin 2007-12-20 16:32:28 MSK
Патч приложен к сборке 0.1h-alt4, спасибо!
(не прошло и полгода :)