Re: Ext3 vs NTFS performance

Theodore Tso
2007-05-05T02:12:55Z

On Fri, May 04, 2007 at 07:49:13PM +0400, Michael Tokarev wrote:
>
> How about providing a way to stop kernel (or filesystem) to make gaps
> in files instead? Like some ioctl(fd, FS_NOGAPS, 1) -- pretty much
> like 'doze has, just the opposite (on windows, this flag is "on" by
> default).

This is being worked on already. XFS has a per-filesystem ioctl, but
we want to create a filesystem-independent system call,
sys_fallocate(), that would wired into the already existing
posix_fallocate() function exported by glibc.

> It's even worse: imagine samba transforms this into write(zeros) (as
> preallocate isn't available yet), and at the same time, another process
> is writing there... Which will be perfectly valid in current case, but
> will go wrong way (overwriting just-written data with zeros) in this
> new scenario.

Samba can just use the posix_fallocate() system call. Note that if
you have two processes are writing to the same file without proper
locking, you're probably going to run into potential problems anyway.
What if one process is writing whole blockfuls of data, while some
brain-damaged Windows client is writing a byte of zero every 128k, and
thus subtly corrupting the data written by the first process? We
can't fix brain-damaged applications that aren't doing proper
application level locking....

(Aside, of course, from convincing people to switch away from Vista to
Linux. :-)

- Ted