On 09/16/2010 01:21 PM, JD wrote:
>
>
> On 09/16/2010 09:42 AM, Sameer Naik wrote:
>> Thanks i will try it out.
>>
>> On Thu, Sep 16, 2010 at 9:59 PM, JD<jd1...@gmail.com>  wrote:
>>>
>>> On 09/16/2010 03:00 AM, Sameer Naik wrote:
>>>> Please find attached.
>>>> P.S. I have added the fflush () call before the fsync () call.
>>>>
>>>> Regards
>>>> ~Sameer
>>> Well, as I already communicated with Pierre, the man page for fsync 
>>> says:
>>>
>>>        Calling fsync() does not necessarily ensure that the entry in 
>>> the
>>>        directory containing the file has also reached disk. For 
>>> that, an
>>>        explicit fsync() on a file descriptor for the directory is also
>>>        needed.
>>>
>>> So, when creating a new file, it is not sufficient to flush and 
>>> fsync the
>>> file descriptor.
>>> You also need to have opened the containing directory and fsync'ed the
>>> directory
>>> file descriptor immediately after creating the file. flushing and 
>>> sync'ing
>>> the file
>>> comes later when you are done with writing to it.
>>>
>>> Cheers,
>>>
>>> JD
>>>
>
> Remember that a directory can only be opened by
>        DIR *opendir(const char *name);
>        DIR *fdopendir(int fd);
>
> Problem is, how can you fsync a dir if you cannot open it
> with the open(2) system call?
> fsync(2) needs a file descriptor.
> DIR *  is not a file descriptor.
>
> And yet, the man page for fsync says:
>
>        Calling  fsync()  does  not  necessarily  ensure  that the 
> entry in the
>        directory containing the file has  also  reached  disk. For  
> that  an
>        explicit fsync() on a file descriptor for the directory is also 
> needed.
>
> Maybe someone can clear this up a bit?
>
>
It seems this issue was also discussed in this blog:

http://caml.inria.fr/mantis/view.php?id=2533

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
ntfs-3g-devel mailing list
ntfs-3g-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel

Reply via email to