This forum has been archived. All content is frozen. Please use KDE Discuss instead.

troubles when disc full

Tags: None
(comma "," separated)
cyrylas
Registered Member
Posts
59
Karma
0

troubles when disc full

Sun Jun 04, 2006 3:17 pm
Few days ago I left KTorrent downloading for night, but firs checked, if there's space on the disc for whole file. There was.

At the morning i saw no free space left (weird, becouse there sould be about 300MB free), but torrent was downloaded and was being seeded now.
Few moment ago I imported this torrent in Azureus, and it shows, that it's downloaded only in 92,6%.
George
Moderator
Posts
5421
Karma
1

Re: troubles when disc full

Sun Jun 04, 2006 4:04 pm
cyrylas wrote:Few days ago I left KTorrent downloading for night, but firs checked, if there's space on the disc for whole file. There was.

At the morning i saw no free space left (weird, becouse there sould be about 300MB free), but torrent was downloaded and was being seeded now.
Few moment ago I imported this torrent in Azureus, and it shows, that it's downloaded only in 92,6%.


What version are you using ? We preallocate all diskpace so the size it takes up, should not change.
cyrylas
Registered Member
Posts
59
Karma
0

Sun Jun 04, 2006 5:41 pm
This happened on SVN version from about week or two ago. Don't know exacly because i did update today.
cyrylas
Registered Member
Posts
59
Karma
0

Re: troubles when disc full

Sun Jun 04, 2006 10:29 pm
George wrote:What version are you using ? We preallocate all diskpace so the size it takes up, should not change.


How are you preallocating space exacly? I've just found that ktorrent makes file which has torrent size, but free space on drive reported by for example krusader doesn't make any smaller.

I made small test:
Now I have exacly 381MB free on drive and tried to start torrent having over 12GB size. And guess what - it successfully started :)

Loading file /tmp/kde-majkel/ktorrentlKbbBb.tmp
Encoding : UTF-8
Multi file torrent
OutputPath = /home/majkel/dl/futurama/
Starting download
Pre-allocating diskspace
MultiFileCache::preallocateDiskSpace
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 1/Futurama - S01E01 - Space Pilot 3000 [dd].avi (183474176 bytes)
file_size = 183474176
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 1/Futurama - S01E02 - The Series Has Landed [dd].avi (183461888 bytes)
file_size = 183461888
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 1/Futurama - S01E03 - I, Roommate [dd].avi (183496704 bytes)
file_size = 183496704
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 1/Futurama - S01E04 - Love's Labours Lost In Space [dd].avi (183504896 bytes)
file_size = 183504896
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 1/Futurama - S01E05 - Fear Of A Bot Planet [dd].avi (183500800 bytes)
file_size = 183500800
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 1/Futurama - S01E06 - A Fishfull Of Dollars [dd].avi (183484416 bytes)
file_size = 183484416
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 1/Futurama - S01E07 - My Three Suns [dd].avi (183504896 bytes)
file_size = 183504896
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 1/Futurama - S01E08 - A Big Piece Of Garbage [dd].avi (183504896 bytes)
file_size = 183504896
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 1/Futurama - S01E09 - Hell Is Other Robots [dd].avi (183492608 bytes)
file_size = 183492608
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 2/Futurama - S02E01 - A Flight To Remember [dd].avi (183474176 bytes)
file_size = 183474176
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 2/Futurama - S02E02 - Mars University [dd].avi (183506944 bytes)
file_size = 183506944
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 2/Futurama - S02E03 - When Aliens Attack [dd].avi (183484416 bytes)
file_size = 183484416
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 2/Futurama - S02E04 - Fry & The Slurm Factory [dd].avi (183506944 bytes)
file_size = 183506944
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 2/Futurama - S02E05 - I Second That Emotion [dd].avi (183476224 bytes)
file_size = 183476224
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 2/Futurama - S02E06 - Brannigan, Begin Again [dd].avi (183494656 bytes)
file_size = 183494656
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 2/Futurama - S02E07 - A Head In The Polls [dd].avi (183529472 bytes)
file_size = 183529472
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 2/Futurama - S02E08 - Xmas Story [dd].avi (183545856 bytes)
file_size = 183545856
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 2/Futurama - S02E09 - Why Must I Be A Crustacean In Love [dd].avi (183455744 bytes)
file_size = 183455744
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 2/Futurama - S02E10 - Put Your Head On My Shoulders [dd].avi (183511040 bytes)
file_size = 183511040
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 2/Futurama - S02E11 - The Lesser Of Two Evils [dd].avi (183568384 bytes)
file_size = 183568384
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 2/Futurama - S02E12 - Raging Bender [dd].avi (183539712 bytes)
file_size = 183539712
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 2/Futurama - S02E13 - A Bicyclops Built For Two [dd].avi (183496704 bytes)
file_size = 183496704
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 2/Futurama - S02E14 - How Hermes Requisitioned His Groove Back [dd].avi (183525376 bytes)
file_size = 183525376
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 2/Futurama - S02E15 - A Clone Of My Own [dd].avi (183496704 bytes)
file_size = 183496704
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 2/Futurama - S02E16 - The Deep South [dd].avi (183504896 bytes)
file_size = 183504896
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 2/Futurama - S02E17 - Bender Gets Made [dd].avi (183521280 bytes)
file_size = 183521280
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 2/Futurama - S02E18 - The Problem With Popplers [dd].avi (183517184 bytes)
file_size = 183517184
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 2/Futurama - S02E19 - Mother's Day [dd].avi (183574528 bytes)
file_size = 183574528
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 2/Futurama - S02E20 - Anthology Of Interest I [dd].avi (183560192 bytes)
file_size = 183560192
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 3/Futurama - S03E01 - The Honking [dd].avi (183549952 bytes)
file_size = 183549952
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 3/Futurama - S03E02 - War Is The H-Word [dd].avi (183549952 bytes)
file_size = 183549952
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 3/Futurama - S03E03 - The Cryonic Woman [dd].avi (183334912 bytes)
file_size = 183334912
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 3/Futurama - S03E04 - Parasites Lost [dd].avi (183566336 bytes)
file_size = 183566336
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 3/Futurama - S03E05 - Amazon Women In The Mood [dd].avi (183519232 bytes)
file_size = 183519232
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 3/Futurama - S03E06 - Bendless Love [dd].avi (183470080 bytes)
file_size = 183470080
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 3/Futurama - S03E07 - The Day The Earth Stood Stupid [dd].avi (183560192 bytes)
file_size = 183560192
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 3/Futurama - S03E08 - That's Lobstertainment! [dd].avi (183470080 bytes)
file_size = 183470080
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 3/Futurama - S03E09 - The Birdbot Of Ice-Catraz [dd].avi (183453696 bytes)
file_size = 183453696
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 3/Futurama - S03E10 - Luck Of The Fryrish [dd].avi (183941120 bytes)
file_size = 183941120
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 3/Futurama - S03E11 - The Cyber House Rules [dd].avi (183476224 bytes)
file_size = 183476224
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 3/Futurama - S03E12 - Insane In The Mainframe [dd].avi (183470080 bytes)
file_size = 183470080
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 3/Futurama - S03E13 - Bendin' In The Wind [dd].avi (183472128 bytes)
file_size = 183472128
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 3/Futurama - S03E14 - Time Keeps On Slipping [dd].avi (183470080 bytes)
file_size = 183470080
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 3/Futurama - S03E15 - I Dated A Robot [dd].avi (183519232 bytes)
file_size = 183519232
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 4/Futurama - S04E01 - Roswell That Ends Well [dd].avi (184061952 bytes)
file_size = 184061952
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 4/Futurama - S04E02 - A Tale Of Two Santas [dd].avi (183552000 bytes)
file_size = 183552000
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 4/Futurama - S04E03 - Anthology Of Interest II [dd].avi (183676928 bytes)
file_size = 183676928
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 4/Futurama - S04E04 - Love And Rocket [dd].avi (183842816 bytes)
file_size = 183842816
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 4/Futurama - S04E05 - Leela's Homeworld [dd].avi (183506944 bytes)
file_size = 183506944
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 4/Futurama - S04E06 - Where The Buggalo Roam [dd].avi (183496704 bytes)
file_size = 183496704
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 4/Futurama - S04E07 - A Pharaoh To Remember [dd].avi (183455744 bytes)
file_size = 183455744
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 4/Futurama - S04E08 - Godfellas [dd].avi (183468032 bytes)
file_size = 183468032
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 4/Futurama - S04E09 - Futurestock [dd].avi (183535616 bytes)
file_size = 183535616
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 4/Futurama - S04E10 - A Leela Of Her Own [dd].avi (183447552 bytes)
file_size = 183447552
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 4/Futurama - S04E11 - 30% Iron Chef [dd].avi (183447552 bytes)
file_size = 183447552
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 4/Futurama - S04E12 - Where No Fan Has Gone Before [dd].avi (184258560 bytes)
file_size = 184258560
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 5/Futurama - S05E01 - Crimes Of The Hot [dd].avi (183609344 bytes)
file_size = 183609344
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 5/Futurama - S05E02 - Jurassic Bark [dd].avi (183541760 bytes)
file_size = 183541760
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 5/Futurama - S05E03 - The Route Of All Evil [dd].avi (183476224 bytes)
file_size = 183476224
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 5/Futurama - S05E04 - A Taste Of Freedom [dd].avi (183568384 bytes)
file_size = 183568384
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 5/Futurama - S05E05 - Kif Gets Knocked Up A Notch [dd].avi (183506944 bytes)
file_size = 183506944
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 5/Futurama - S05E06 - Less Than Hero [dd].avi (183517184 bytes)
file_size = 183517184
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 5/Futurama - S05E07 - Teenage Mutant Leela's Hurdles [dd].avi (183515136 bytes)
file_size = 183515136
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 5/Futurama - S05E08 - The Why Of Fry [dd].avi (183511040 bytes)
file_size = 183511040
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 5/Futurama - S05E09 - The Sting [dd].avi (184248320 bytes)
file_size = 184248320
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 5/Futurama - S05E10 - The Farnsworth Parabox [dd].avi (184250368 bytes)
file_size = 184250368
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 5/Futurama - S05E11 - Three Hundred Big Boys [dd].avi (184260608 bytes)
file_size = 184260608
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 5/Futurama - S05E12 - Spanish Fry [dd].avi (184231936 bytes)
file_size = 184231936
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 5/Futurama - S05E13 - Bend Her [dd].avi (184250368 bytes)
file_size = 184250368
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 5/Futurama - S05E14 - Obsoletely Fabulous [dd].avi (184236032 bytes)
file_size = 184236032
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 5/Futurama - S05E15 - Bender Should Not Be Allowed On TV [dd].avi (183515136 bytes)
file_size = 183515136
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Futurama - Season 5/Futurama - S05E16 - The Devil's Hands Are Idle Playthings [dd].avi (184258560 bytes)
file_size = 184258560
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/Torrent downloaded from Demonoid.com.txt (47 bytes)
file_size = 47
Preallocating file /home/majkel/.kde/share/apps/ktorrent/tor8/cache/nfo.txt (156 bytes)
file_size = 156
Doing tracker request to url : http://inferno.demonoid.com:3391/announ ... &port=6866 &uploaded=0&downloaded=0&left=13219786955&compact=1&numwant=100&key=2018541112 &event=started&info_hash=%b2%87%02%a9%d8%84%fb%07%a1%df%ed%a8%0dc%05%07%c9%a2I-
Initiating connection to 70.137.135.134
Initiating connection to 71.226.193.150
Initiating connection to 70.124.188.167
Initiating connection to 61.84.49.198
Initiating connection to 81.154.38.215
(...)
Authentication to 61.84.49.198 : ok
Authentication to 66.188.188.20 : ok
Authentication to 70.137.135.134 : ok
Doing tracker request to url : http://inferno.demonoid.com:3391/announ ... port=6866& uploaded=0&downloaded=229376&left=13219786955&compact=1&numwant=0& key=2018541112&event=stopped& info_hash=%b2%87%02%a9%d8%84%fb%07%a1%df%ed%a8%0dc%05%07%c9%a2I-
Saving 3 chunk downloads
Authentication(S) to 80.195.63.56 : ok

Last edited by cyrylas on Mon Jun 05, 2006 11:25 pm, edited 2 times in total.
George
Moderator
Posts
5421
Karma
1

Mon Jun 05, 2006 8:26 am
We use ftruncate to preallocate the files.

If you do an ls -l of the preallocated files, how much is reported ?
cyrylas
Registered Member
Posts
59
Karma
0

Mon Jun 05, 2006 11:22 pm
ls -l shows size of full file. But look just at the screenshoot below, to see, that there's something not good. It was took yesterday with that allocated file over 12GB.

Image

The more I'm investigating this thing, the more weird it's making.

Once again. That everything in my computer before i start any torrent:
Image
Then I started downloading largest torrent file ever found: size 25,82GB:
Image
It started, but nowhere i have so much free space. And now, afeer few megs of download:
Image

Torrent is saving into /home/majkel/dl, so there's dafinately should be some error, because this torrent is even bigger than whole partition...

Code: Select all
$ ls -l
razem 28414
-rw-r--r--  1 majkel majkel 4678189056 cze  6 01:51 LEAVE_IT_TO_BEAVER_S2_D1_SIDE_A.iso
-rw-r--r--  1 majkel majkel       1191 cze  6 01:51 LEAVE_IT_TO_BEAVER_S2_D1_SIDE_A.sfv
-rw-r--r--  1 majkel majkel 4677533696 cze  6 01:51 LEAVE_IT_TO_BEAVER_S2_D1_SIDE_B.iso
-rw-r--r--  1 majkel majkel 4677074944 cze  6 01:51 LEAVE_IT_TO_BEAVER_S2_D2_SIDE_A.iso
-rw-r--r--  1 majkel majkel 4678156288 cze  6 01:51 LEAVE_IT_TO_BEAVER_S2_D2_SIDE_B.iso
-rw-r--r--  1 majkel majkel 4677271552 cze  6 01:51 LEAVE_IT_TO_BEAVER_S2_D3_SIDE_A.iso
-rw-r--r--  1 majkel majkel 4329232384 cze  6 01:51 LEAVE_IT_TO_BEAVER_S2_D3_SIDE_B.ISO
-rw-r--r--  1 majkel majkel     757234 cze  6 01:51 LITB S2 Cover 1.jpg
-rw-r--r--  1 majkel majkel     735326 cze  6 01:51 LITB S2 Cover 2.jpg
-rw-r--r--  1 majkel majkel     780854 cze  6 01:51 LITB S2 Cover 3.jpg
-rw-r--r--  1 majkel majkel         47 cze  6 01:51 Torrent downloaded from Demonoid.com.txt


More interesting are results of that commend:
Code: Select all
$ ls -s
razem 32914
4894 LEAVE_IT_TO_BEAVER_S2_D1_SIDE_A.iso
   4 LEAVE_IT_TO_BEAVER_S2_D1_SIDE_A.sfv
8561 LEAVE_IT_TO_BEAVER_S2_D1_SIDE_B.iso
4460 LEAVE_IT_TO_BEAVER_S2_D2_SIDE_A.iso
4461 LEAVE_IT_TO_BEAVER_S2_D2_SIDE_B.iso
6217 LEAVE_IT_TO_BEAVER_S2_D3_SIDE_A.iso
4301 LEAVE_IT_TO_BEAVER_S2_D3_SIDE_B.ISO
   5 LITB S2 Cover 1.jpg
   5 LITB S2 Cover 2.jpg
   5 LITB S2 Cover 3.jpg
   4 Torrent downloaded from Demonoid.com.txt
stoeptegel
Registered Member
Posts
1075
Karma
0

Tue Jun 06, 2006 6:27 am
Spooky, that's about all i think of it.
I would go and fsck my filesystem if i were you, this doesn't add up.
cyrylas
Registered Member
Posts
59
Karma
0

Tue Jun 06, 2006 1:48 pm
I know it's impossible :) - checked, filesystem is clean.

I tried baobab and it shows some nice info (is there an easy way to temporaly change language in KDE to english? Then I could put info in readable to everybody langualge :) ):
Image

It tells, that filesize is 4.4GB, but allready localized only 4.9MB.

I thint that, ftruncate isn't allocating file on disc, bul onty tells filesystem, that file, which will be there some day will have 4.4GB, but not now.
George
Moderator
Posts
5421
Karma
1

Tue Jun 06, 2006 5:19 pm
Must be the file system, it should give an error when this is not possible.
imported4-Tomasu
Registered Member
Posts
302
Karma
0

Tue Jun 06, 2006 11:20 pm
Are you (the devs) absolutely sure that ftruncate will actually allocate all the needed blocks? most filesystems these days have sparse file support by default, so if all you do is set the size, or seek somewhere and write, its only going to allocate the needed blocks. AFAIK, you have to physically go out and write _something_ to the entire file for it to actually allocate blocks.
agforsyth
Registered Member
Posts
133
Karma
0

Tue Jun 06, 2006 11:37 pm
Tomasu wrote:Are you (the devs) absolutely sure that ftruncate will actually allocate all the needed blocks? most filesystems these days have sparse file support by default, so if all you do is set the size, or seek somewhere and write, its only going to allocate the needed blocks. AFAIK, you have to physically go out and write _something_ to the entire file for it to actually allocate blocks.


I'm pretty sure you have to specifically create a sparse file if that's what you want on all filesystems that support it. I don't know anything about ftruncate specifically, but I very much doubt the problem has anything to do with sparse files.
imported4-Tomasu
Registered Member
Posts
302
Karma
0

Tue Jun 06, 2006 11:45 pm
but I very much doubt the problem has anything to do with sparse files.
AFAIK, linux/ext[23] does sparse files by default. Its kinda how it works. I read up on the ext algorithm a while back, and basically, it only allocates when needed, though it will preallocate some adjacent blocks on creation/write, then free the non used preallocated blocks.

And if XFS, JFS, and Reiser didn't work this way, I'd be very surprised.

ktorrent currently allocates multi GB files in meer seconds (if theres allot), whereas any other BT client will take up to minutes per torrent (of course that depends on the size).
George
Moderator
Posts
5421
Karma
1

Wed Jun 07, 2006 4:14 pm
Tomasu wrote:
but I very much doubt the problem has anything to do with sparse files.
AFAIK, linux/ext[23] does sparse files by default. Its kinda how it works. I read up on the ext algorithm a while back, and basically, it only allocates when needed, though it will preallocate some adjacent blocks on creation/write, then free the non used preallocated blocks.

And if XFS, JFS, and Reiser didn't work this way, I'd be very surprised.

ktorrent currently allocates multi GB files in meer seconds (if theres allot), whereas any other BT client will take up to minutes per torrent (of course that depends on the size).


Still it should **** out when there is not enough diskspace left.
Manually preallocating is a pain and very slow.
imported4-Tomasu
Registered Member
Posts
302
Karma
0

Wed Jun 07, 2006 4:37 pm
Still it should **** out when there is not enough diskspace left.
Actual free space is calculated using the number of free chunks, since none are actually allocated to blank/sparse points in the files, it doesn't show up as used.

Manually preallocating is a pain and very slow.
Tis how everyone else has to handle it. Clients like Azureus, and other clients have several allocation modes, "manual, write all bytes" which takes forever but is guaranteed to make sure you get the file allocated, and as un fragmented as possible, and then theres plain just write when needed, and then theres the ftruncate option which "should" work on less sophisticated filesystems, that dont bother to do any preallocation or use any anti fragmentation algorithms. Ext is "normally" good at keeping itself free from major fragmentation, that is till you start downloading many files using p2p clients and sparse files. I totally fraged up a few filesystems that way, till the transfer speed was down to less than 1 MB/s and fsck said it was about 60-80 % non-contiguous.

As far as I've been able to check (I'll look harder later, but I see no libc method of creating non sparse files on linux), there is no other way to totally preallocate a file. Now, if you want to save a little time in allocation, grab the block size of the fs, and the number of blocks the file is likely to take up, and write 1 byte or word to each block. should take a little less time, hopefully (I'm not so sure, as fast as io is these days, 4k shouldn't take any longer than 4 bytes once its in the queue.) It would be easy to test anyhow.
George
Moderator
Posts
5421
Karma
1

Wed Jun 07, 2006 4:43 pm
We originally intended to preallocate the whole file manually, but then found ftruncate. I guess we will have to add a slow mode.


Bookmarks



Who is online

Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]