From: Boudewijn Dijkstra on
Op Mon, 18 Jan 2010 13:38:20 +0100 schreef Noob <root(a)127.0.0.1>:
> Paul Keinanen wrote:
>> On Fri, 15 Jan 2010 08:44:33 +0000, Nobody wrote:
>>
>> Of course, writing to the file and fsyncing should be done from the same
>> thread.
>
> OK, but many threads may be writing to the disk "at the same time"

but not to the same file I hope?

> i.e. concurrently, whereas vfs_sync is supposed to flush everything
> to disk (even data and metadata from other threads).

Perhaps you're reading over the initial 'f' of fsync.


--
Gemaakt met Opera's revolutionaire e-mailprogramma:
http://www.opera.com/mail/
(remove the obvious prefix to reply by mail)
From: Noob on
Boudewijn Dijkstra wrote:

> Noob wrote:
>
>> Paul Keinanen wrote:
>>
>>> Of course, writing to the file and fsyncing should be done from the same thread.
>>
>> OK, but many threads may be writing to the disk "at the same time"
>
> but not to the same file I hope?

Each thread writes to its own file, in its own directory.

>> i.e. concurrently, whereas vfs_sync is supposed to flush everything
>> to disk (even data and metadata from other threads).
>
> Perhaps you're reading over the initial 'f' of fsync.

I don't quite understand.

I think you're saying fsync works on a file, whereas sync works on an
entire volume, but I'm not getting your point.

On my system, fsync is called vfs_fflush, and I've tried calling it
right before closing a file, but the OS still runs fsck when I replug
the drive. Calling sync seems to make the OS happy.

Regards.
From: Boudewijn Dijkstra on
Op Tue, 19 Jan 2010 13:37:25 +0100 schreef Noob <root(a)127.0.0.1>:
> Boudewijn Dijkstra wrote:
>> Noob wrote:
>>
>>> i.e. concurrently, whereas vfs_sync is supposed to flush everything
>>> to disk (even data and metadata from other threads).
>>
>> Perhaps you're reading over the initial 'f' of fsync.
>
> I don't quite understand.
>
> I think you're saying fsync works on a file, whereas sync works on an
> entire volume, but I'm not getting your point.

Paul asked about fsync, but your reply only mentioned other functions.
That was my point.

> On my system, fsync is called vfs_fflush,

Says who? fsync and fflush are supposed to be different things, with
different purposes and differing behaviour.

> and I've tried calling it
> right before closing a file, but the OS still runs fsck when I replug
> the drive. Calling sync seems to make the OS happy.



--
Gemaakt met Opera's revolutionaire e-mailprogramma:
http://www.opera.com/mail/
(remove the obvious prefix to reply by mail)
From: Noob on
Boudewijn Dijkstra wrote:

> Noob wrote:
>
>> On my system, fsync is called vfs_fflush,
>
> Says who? fsync and fflush are supposed to be different things, with
> different purposes and differing behaviour.

In the OS I'm using, there's no fsync, and the documentation for fflush states:

"vfs_fflush() writes any outstanding data (and metadata) for this file
to the physical device."

vfs_fflush is closer to POSIX fsync than to POSIX fflush, don't you agree?

Reference for myself:
http://www.opengroup.org/onlinepubs/009695399/functions/fsync.html
http://www.opengroup.org/onlinepubs/009695399/functions/fflush.html

Regards.
From: Boudewijn Dijkstra on
Op Tue, 19 Jan 2010 15:56:41 +0100 schreef Noob <root(a)127.0.0.1>:
> Boudewijn Dijkstra wrote:
>> Noob wrote:
>>
> vfs_fflush is closer to POSIX fsync than to POSIX fflush, don't you
> agree?

It is not about what is closer, it is about what works for you.

And since your FS implementation is clearly unequal to POSIX, I believe
that only people familiar with it can help you further.


--
Gemaakt met Opera's revolutionaire e-mailprogramma:
http://www.opera.com/mail/
(remove the obvious prefix to reply by mail)