tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[PATCH] PUFFS backend allocation (round 3)



Summary: when writing to a PUFFS filesystem through page cache, we do
not know if backend storage is really available. If it is not, cache
flush may get EDQUOT or ENOSPC and the process cannot terminate (it gets
stuck in DE state).

Proposed solution: detect that a write may not have backend storage, and
if it is the case, try to allocate the backend storage.

Detecting is done on two conditions:
- if allocated blocks is shorter than size, the file is sparse and we
never know if we are writing in a hole or not: in that case, always
write-once
- if writing beyond EOF

Allocating the backend storage is done
- through newly introduced PUFFS fallocate operation (unlikely to work
on NetBSD as the system call exists but FFS does not support it)
- otherwise by reading from the file and rewriting the readen data

The latest patch doing this:
http://ftp.espci.fr/shadow/manu/puffs-alloc2.patch

Opinions?

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index