FSSetForkSize writing massive amounts of data over network?
FSSetForkSize writing massive amounts of data over network?
- Subject: FSSetForkSize writing massive amounts of data over network?
- From: James Bucanek <email@hidden>
- Date: Wed, 2 Feb 2011 16:36:32 -0700
Greetings,
A customer reported this problem, which I don't remember ever
seeing, but it's real. My application pre-flights some
operations by reserving the necessary file space for some really
large files that *might* need to be duplicated. If they do need
to be duplicated, the reserved file is already allocated and the
process doesn't have to worry about running out of disk space
while the file is being copied/modified--which would be a total disaster.
One customer is writing and saying my application takes forever
to get started when the destination file is on his file server.
On further investigation, the call to FSSetForkSize is
percolating down and calling pwrite, which is writing gigabytes
of data over the network:
8910 Thread_363062
8910 thread_start
8910 _pthread_start
8910 __NSThread__main__
8910 0x10001504c
8910 0x100010c70
8910 0x10000d966
8910 0x100012b38
8910 0x100021788
8910 0x10002fc6f
8910 0x10009a9ce
8910 FSSetForkSize
8910 PBSetForkSizeSync
8910 SetForkLength(FileRecord*,
unsigned char, unsigned long long, unsigned long long*)
8910 pwrite
I thought it might be an unusual file system or server, but they
assure me that it's a PowerMac and Mini, both running 10.6, over
ethernet. The Mini is connected via Firewire to a IOMega RAID
(0) formatted HFS+.
I confirmed that this is happening with a similar configuration
here, which really surprises me. On local volumes, an
FSSetForkSize is as fast as a delete, and simply assigns free
blocks to the file.
Next I tried to use FSAllocateFork on the network volume and it
returns almost instantly, but it also doesn't appear to do
anything. Testing the free space on the volume before and after
the FSAllocateFork call returns the same value. Setting the fork
size after the FSAllocateFork call produces the same results as
before. So it doesn't appear that anything was actually
allocated by FSAllocateFork.
I repeated these same tests on a local hard drive and got
exactly what I expected: FSAllocateFork immediately reduced the
available disk space, and FSSetForkSize immediately allocated
the data to the file and returned.
Can anyone shed some light on to what's going on? I'd really
like to avoid this, and there are several other situations where
I set the size of a fork and don't want massive amounts of data
to be written over a network.
Thanks,
James
--
James Bucanek
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden