hi, > YAMAMOTO Takashi <[email protected]> wrote: > >> > We would have a PNODE_IN_RESIZE flag for struct pnode's pn_stat, set and >> > cleared in dosetattr(), and use vp->v_size on uvm_vnp_setsize() calls >> > when set? Or just avoid uvm_vnp_setsize() calls? >> >> just avoid the calls. > > There is a problem if two threads enter dosetattr() at the same time: > the flag would be cleared on first thread completing the operation, and > we get the same race again.
is there any particular order between threads in that case? otherwise, a pending setattr counter should be enough. getattr ignores a part of file attributes from the file server unless the counter is 0. YAMAMOTO Takashi > > Therefore I think a mutex must guard setattr/uvm_vnp_setsize in > dosettatr(). Does it makes sense to reuse an existing mutex (which > one?), or should I introduce a new one, for instance pn_inrewrite in > struct pnode? > > -- > Emmanuel Dreyfus > http://hcpnet.free.fr/pubz > [email protected]
