[ccache] [PATCH] nfs/mmap/rename file corruption

Martin Pool mbp at sourcefrog.net
Thu Aug 28 12:58:18 EST 2003


Please apply:



*** ccache.yo	17 Feb 2003 00:46:43 -0000	1.22
--- ccache.yo	28 Aug 2003 02:57:26 -0000
***************
*** 302,307 ****
--- 302,313 ----
  it() ccache avoids a double call to cpp on a cache miss
  )
  
+ manpagesection(BUGS)
+ 
+ When the cache is stored on an NFS filesystem, the filesystem must be
+ exported with the bf(no_subtree_check) option to make renames between
+ directories reliable.
+ 
  manpagesection(CREDITS)
  
  Thanks to the following people for their contributions to ccache








On Thu, 28 Aug 2003 12:17:39 +1000
Martin Pool <mbp at sourcefrog.net> wrote:

> In summary: to make ccache work safely on an NFS filesystem, the
> filesystem must be exported with no_subtree_check.  Otherwise data can
> be lost when it renames recently-written files. :-(
> 
> 
> 
> ----------------------
> Begin forwarded message:
> 
> Date: 27 Aug 2003 21:37:38 -0400
> From: Trond Myklebust <trond.myklebust at fys.uio.no>
> To: Martin Pool <mbp at sourcefrog.net>
> Cc: nfs at lists.sourceforge.net
> Subject: Re: [NFS] nfs/mmap/rename file corruption
> 
> 
> >>>>> " " == Martin Pool <mbp at sourcefrog.net> writes:
> 
>      > - ccache runs distcc with output to a temporary file
>      >  - distcc opens, mmaps, writes to, munmaps, and closes the
> temporary     >    file
>      > - distcc exits
>      >  - ccache renames the temporary file to its proper location in
> the     >    ccache
>      > - ccache opens the file read only, and reads from it
> 
> Is this a rename from one directory to the other? If so, are you using
> the 'no_subtree_check' option on the server? Without the latter option
> enabled, I would indeed expect the behaviour that you describe.
> 
> Cheers,
>   Trond
> 
> 
> -- 
> Martin 
> _______________________________________________
> ccache mailing list
> ccache at lists.samba.org
> http://lists.samba.org/mailman/listinfo/ccache


-- 
Martin 



More information about the ccache mailing list