Opened 10 years ago

Last modified 23 months ago

#4012 new bug

NTFS handles deletions incorrectly

Reported by: axeld Owned by: 3dEyes
Priority: critical Milestone: R1
Component: File Systems/NTFS Version: R1/Development
Keywords: Cc: Jens.Arm@…, alexbl@…
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

When a file is unlinked/deleted, you must only make it unavailable to the user (ie. it must not appear in file listings anymore, and cannot be opened).

However, its space on disk must not be deleted until the kernel no longer needs the file (it will then call fs_remove_vnode()). Until that one is called, an application with an open file handle must still be able to read from that file, and write to that file as if it would still exist.

Please check if the file system remains valid when actually doing so - in that case, the priority could be put back to "high". As is, I wouldn't enable read/write for the file system yet.

Change History (11)

comment:1 Changed 10 years ago by jahaiku

Cc: Jens.Arm@… added

comment:2 Changed 9 years ago by alexbl

Cc: alexbl@… added

Is this the same issue that stops you from being able to upgrade a running system? (and thus not ntfs specific)?

comment:3 in reply to:  2 ; Changed 9 years ago by axeld

Version: R1/pre-alpha1R1/Development

Replying to alexbl:

Is this the same issue that stops you from being able to upgrade a running system? (and thus not ntfs specific)?

No, that would be the missing MAP_COPY semantics, and totally unrelated to this particular problem. The same is true for all major operating systems, anyway (not that I would like it, though).

Another problem is that Haiku will try to reload drivers when you replace them which obviously turns out to be problematic as well in some cases (needs investigation).

comment:4 in reply to:  3 ; Changed 9 years ago by alexbl

Replying to axeld:

Replying to alexbl:

Is this the same issue that stops you from being able to upgrade a running system? (and thus not ntfs specific)?

No, that would be the missing MAP_COPY semantics, and totally unrelated to this particular problem. The same is true for all major operating systems, anyway (not that I would like it, though).

This NTFS issue?

Another problem is that Haiku will try to reload drivers when you replace them which obviously turns out to be problematic as well in some cases (needs investigation).

Is there a bug for the live-upgrade problem? Seems like it would be good to have one so that there is a place where information about the problem can be gleaned incase someone wants to try and fix it. :)

comment:5 in reply to:  4 ; Changed 9 years ago by axeld

Replying to alexbl:

Replying to axeld:

Replying to alexbl:

Is this the same issue that stops you from being able to upgrade a running system? (and thus not ntfs specific)?

No, that would be the missing MAP_COPY semantics, and totally unrelated to this particular problem. The same is true for all major operating systems, anyway (not that I would like it, though).

This NTFS issue?

Of course not. Is it really that hard to parse that paragraph? At least I would have a hard time understanding it that way.

Another problem is that Haiku will try to reload drivers when you replace them which obviously turns out to be problematic as well in some cases (needs investigation).

Is there a bug for the live-upgrade problem? Seems like it would be good to have one so that there is a place where information about the problem can be gleaned incase someone wants to try and fix it. :)

Not that I know of, feel free to report (or look before, as my memory is definitely no replacement for Trac :-)).

comment:6 in reply to:  5 ; Changed 9 years ago by anevilyak

Replying to axeld:

Not that I know of, feel free to report (or look before, as my memory is definitely no replacement for Trac :-)).

Does #2923 count? :)

comment:7 in reply to:  6 Changed 9 years ago by axeld

Replying to anevilyak:

Does #2923 count? :)

Definitely, thanks! :-)

comment:8 Changed 6 years ago by pulkomandy

Just making sure : is this fixed by the new NTFS changes, or not ?

comment:9 Changed 6 years ago by 3dEyes

not yet, but I'm working on it

comment:10 in reply to:  9 ; Changed 23 months ago by stasinek

Replying to 3dEyes:

not yet, but I'm working on it

4 years later... still working?

I have reed the description - why, application is able to write on deleted file?!? WTH? How it's possible any application can delete file opened for writing? This is insanity. I undestand reading (not quite sure - caches, specially for big files) but writing!?!? This is serious bug i see for handling opened files. I know.. Unlocker for Windows but it's named "unlocker" - invalidate handles to opened files then you can do what you want. I undestand VSS, but it's called "snapshot" by very important reason - files consistency, not just one, all of them.

comment:11 in reply to:  10 Changed 23 months ago by jackburton

Replying to stasinek:

I have reed the description - why, application is able to write on deleted file?!? WTH? How it's possible any application can delete file opened for writing? This is insanity.

Nope, this is just how file handling works in any unix system. For example this allows you to copy a file to a different folder, and rename the destination file or folder while you are copying it.

I undestand reading (not quite sure - caches, specially for big files) but writing!?!? This is serious bug i see for handling opened files.

Nope, see above.

I know.. Unlocker for Windows but it's named "unlocker" - invalidate handles to opened files then you can do what you want. I undestand VSS, but it's called "snapshot" by very important reason - files consistency, not just one, all of them.

Windows works differently, in fact it "locks" a file when you open it.

Note: See TracTickets for help on using tickets.