tech-kern archive

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

Re: [PATCH] PUFFS backend allocation (round 3)



On 25 Oct 2014, at 06:39, Emmanuel Dreyfus <manu%netbsd.org@localhost> wrote:

> 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?

At the very least you should increment PUFFSVERSION.

Setting of PNODE_SPARSE looks wrong.  You should mark a VREG pnode
as sparse until it is sure not to have holes, which is when we get
va_bytes != VNOVAL && vp->v_size == rvap->va_bytes.

--
J. Hannken-Illjes - hannken%eis.cs.tu-bs.de@localhost - TU Braunschweig (Germany)



Home | Main Index | Thread Index | Old Index