Bug 12117

Summary: Gpart fails to open large files (e.g. disk images)
Product: Sisyphus Reporter: Konstantin Uvarin (lodin) <khedin>
Component: gpartAssignee: Michael Shigorin <mike>
Status: CLOSED FIXED QA Contact: qa-sisyphus
Severity: minor    
Priority: P2 CC: mike, vsu
Version: unstable   
Hardware: all   
OS: Linux   
Attachments:
Description Flags
The patch that adds O_LARGEFILE none

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, спасибо!
(не прошло и полгода :)