Subject: Re: ubc and nfs file truncation
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
From: Chuck Silvers <chuq@chuq.com>
List: tech-kern
Date: 07/18/2004 23:15:05
hi,

the solution I'd prefer is that ubc_fault() be changed to not need to
know the object's size.  this would allow us to use the UBC interfaces
for non-vnode objects as well, which is desirable for its own sake.
I was just talking with someone else on what was needed for this,
give me a few days and I'll see what I can come up with.

-Chuck


On Sun, Jul 18, 2004 at 04:58:05PM +0900, YAMAMOTO Takashi wrote:
> hi,
> 
> ubc assumes a file's v_size is never changed while it has
> ubc mappings.  (see "npages >= 0" assertion in ubc_fault)
> while it's true for the most of filesystems because of vnode lock,
> it isn't true for nfs because a file can be truncated remotely.
> 
> two solutions i can think of:
> 1. workaround in nfs_loadattrcache.
>    (similar to the case of NMODIFIED/NTRUNCDELAYED)
> 2. workaround in nfs_read.
> 
> the attached diff is 2.
> 
> any comments?
> 
> YAMAMOTO Takashi