FAQ SearchLogin
Tuxera Home
View unanswered posts | View active topics It is currently Thu May 13, 2021 02:30



Post new topic Reply to topic  [ 2 posts ] 
overwriting already written data in a file causes problems 
Author Message

Joined: Sun Jul 17, 2011 13:54
Posts: 1
Post overwriting already written data in a file causes problems
In my application I am continually writing data to file1 and flushing it to the device. In another thread, I am reading data from file1 and writing it to file2. Every time I do the fwrite + fflush on file1, I signal to the other thread to start reading from it. The other thread reads data from file1 and dumps it into file2. Pretty simple logic. Additionally, after every few minutes, I seek back to start of file1 and start overwriting old data.

Now my problem is that once I start overwriting data in file1, the data read into file2 is sometimes the old data (i.e. data written in the previous iteration) even though writer thread has signaled that it wrote the new data (and flushed it).

The catch here is that this problem occurs if the SSD is formatted with Tuxera embedded NTFS driver (evaluation version). If I format it with ext3, the problem goes away. Another interesting observation is that if I have two reader threads, both get stale data at different instants. Event after disabling the SSD write cache (with hdparm -W0 /dev/sda1), I get the same problem with NTFS.

On investigation, it turns out that the NTFS driver does not like me overwriting a file by rewinding the file pointer. Is this a known thing?
I deduced thus because if I open the file in write mode instead of rewinding the file pointer, this issue of data inconsistency goes away.

Any help will be worth its weight in gold...


Sun Jul 17, 2011 14:02
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: overwriting already written data in a file causes problems
Hi,

Quote:
The catch here is that this problem occurs if the SSD is formatted with Tuxera embedded NTFS driver (evaluation version).

This is a community support forum for ntfs-3g, and most people here, including myself, know nothing about Tuxera ntfs. Did you not get directions from Tuxera for reporting bugs in Tuxera ntfs ?

Regards

Jean-Pierre


Tue Jul 19, 2011 18:33
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Original forum style by Vjacheslav Trushkin.