Coda File System

Re: Problem with CODA_LOOKUP (not anymore!!!)

From: Jan Harkes <jaharkes_at_cs.cmu.edu>
Date: Thu, 31 Mar 2005 15:04:25 -0500
On Thu, Mar 31, 2005 at 07:34:29PM +0100, E. Rosten wrote:
> > Returning -ENOENT is definitely the correct thing, the failed lookup
> > will then result in a negative directory cache entry in the kernel
> > (dentry without inode).
> 
> I have to reply with ENOENT (not -ENOENT), since the return type is 
> unsigned.

Yeah, sorry. I was looking at the kernel code where we flip the sign of
the returned error code.
> I have tried that, and it still produces exactly the same result.
> 
> Well, your comment just made me take another look at that block of code 
> (and I have already looked at it 1e99 times) and it turns out I was 
> forgetting to set the write size to sizeof(reply.coda_create). I think 
> that bit was missing because I had a nut loose on my keyboard.

Nice catch, it looks like we are getting the reply size, but never
actually check if we got enough data. Since we always read the reply
into a memory page there is no overflow, but we do end up copying the
zero'd bits into whatever structure we return back to the VFS.

I guess I can add some sanity checks in the upcall reply path, although
it will be the user application that sees an error and not the cache
manager process that performed the short write.

Jan
Received on 2005-03-31 15:05:36