inode of anonymity file

Valdis.Kletnieks at vt.edu Valdis.Kletnieks at vt.edu
Thu Sep 12 00:04:25 EDT 2013


On Thu, 12 Sep 2013 11:38:18 +0800, Grissiom said:

> One question about the unlinked file: if I write a lot of data into a
> unlinked file, where
> will the data be? On the disk or in the RAM? If the data will be on
> the disk, where is it?

Maybe on disk, maybe in RAM, same as any other file data.  Depends if the
disk writeback has gotten around to flushing it yet, if anybody has done
a sync() or fsync(), etc etc.  It behaves exactly the same way as any
other inode, except it's not in a directory.  You keep writing to it,
the file system will keep allocating blocks just like if it was linked,
because blocks are allocated to inodes, not directory entries (and it's
incredibly painful to check where (or even if) a file is linked if your
file system has hundreds of millions of files on it).  So basically everything
that uses an inode or file descriptor will work just the same (even stuff
like fchmod() even though it's sort of meaningless) - it's just things
that use a pathname that no longer work for an unlinked file.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 865 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130912/f534b092/attachment.bin 


More information about the Kernelnewbies mailing list