* Problem with deleted files
@ 2001-01-26 13:38 Simon Munton
2001-01-26 13:53 ` David Woodhouse
0 siblings, 1 reply; 2+ messages in thread
From: Simon Munton @ 2001-01-26 13:38 UTC (permalink / raw)
To: MTD (E-mail), JFFS (E-mail)
Hi,
Consider the following:
Create a file for writing
Unlink it, but don't close it
Write lots of data to the file, so that some nodes get written to the next
flash erase sector
Close it
Use the filesystem enough until the flash sector containing the delete node
is erased.
Unmount the filesystem.
The flash now contains nodes for the file that was deleted, but the node
that says the file was deleted has gone. when remounting the file system,
the file will reappear. (If the file was in a directory that was also
deleted, the mount will fail:'Found inode with no parent and pino'.)
This could be fixed by always setting a node's deleted flag if the
corresponding file's deleted flag is set, when it is written in
jffs_write_node() and jffs_rewrite_data(). Can anyone see any problems with
this?
Should the filesystem fail to mount if it finds a node with no parent? Would
it be better to just throw away such nodes, or perhaps create a virtual
lost+found directory and put them there?
Simon
To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Problem with deleted files
2001-01-26 13:38 Problem with deleted files Simon Munton
@ 2001-01-26 13:53 ` David Woodhouse
0 siblings, 0 replies; 2+ messages in thread
From: David Woodhouse @ 2001-01-26 13:53 UTC (permalink / raw)
To: Simon Munton; +Cc: MTD (E-mail), JFFS (E-mail)
Simon.Munton@m4data.co.uk said:
> This could be fixed by always setting a node's deleted flag if the
> corresponding file's deleted flag is set, when it is written in
> jffs_write_node() and jffs_rewrite_data(). Can anyone see any problems
> with this?
Er... I thought we already did this. Yes, that's what I'd recommend. Once
you're sure it's happy, can you commit the same change to the
linux-2_4-branch too, please?
Simon.Munton@m4data.co.uk said:
> Should the filesystem fail to mount if it finds a node with no parent?
> Would it be better to just throw away such nodes, or perhaps create a
> virtual lost+found directory and put them there?
I'd just let it mark them as deleted. JFFS2 will do that anyway - I'm not
going to bother with marking inodes as deleted. They'll just fade away when
nlink (calculated dynamically from the dirents) gets to zero.
The whole thing gets _so_ much more interesting when you no longer GC in
strict order, and you can GC the 'deletion' nodes before you actually GC
the nodes they're deleting...
--
dwmw2
To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-01-26 13:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-26 13:38 Problem with deleted files Simon Munton
2001-01-26 13:53 ` David Woodhouse
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox