tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[PATCH] GOP_ALLOC and fallocate for PUFFS
Emmanuel Dreyfus <manu%netbsd.org@localhost> wrote:
> When a PUFFS filesystem uses the page cache, data enters the
> cache with no guarantee it will be flushed. If it cannot be flushed
> (bcause PUFFS write requests get EDQUOT or ENOSPC), then the
> kernel will loop forever trying to flush data from the cache,
> and the filesystem cannot be unmounted without -f (and data loss).
After some thoughs about the problem, I am not sure how it can be
solved.
For a given write, PUFFS does not knows if the backed storage is
allocated or not. Of course there is the obvious case of writing beyond
EOF, but in the general case we do not know if we write to a hole or to
an already written area.
If we want to ensure backend allocation is done, we must do a
write-first to the filesystem before filling the cache. But when writing
before EOF, we must first read data from file (possibly getting zeroes
from unallocated area, or real data), then write. And since we have no
way of tracking where we already did a write, we are going to do it for
any write, even for a single byte.
This seems to completely defeats the purpose of the page cache.
Of course things are different if we have fallocate, but it seems not
acehivable in the near future for FFS.
--
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu%netbsd.org@localhost
Home |
Main Index |
Thread Index |
Old Index