tech-kern archive

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

Re: [PATCH] Re: zero-filed page on VOP_PUTPAGES



YAMAMOTO Takashi <yamt%mwd.biglobe.ne.jp@localhost> wrote:

> > +                       rvap->va_size = MAX(rvap->va_size, vp->v_size);
> > + 
> couldn't it be a problem if the size of the file is shrinked by the server?

I am back to this simple fix, after the failure of attempts to avoid
uvm_vnp_setsize() calls from puffs_vnop_getattr() while a
PUFFS_VN_SETATTR is in progress. 

Keeping track of the end of a PUFFS_VN_SETATTR operation turns to be
troublesome. The operation needs to be asynchronous when done by a
kernel thread responsible for freeing memory, otherwise we get a
deadlock. Using puffs_msg_setcall() to get notified of completion does
not help, as soon as I use it, the machine hangs on low memory
situation.

Keeping MAX(rvap->va_size, vp->v_size) in puffs_vnop_getattr() is simple
but it has a drawback with distributed filesystems: a client will not
notify that an open file was shrunk by another client. I think this is
better than deadlocks and data corruption. 

If nobody has a better idea, I will got with this simple fix.

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


Home | Main Index | Thread Index | Old Index