Hi Matt, 2009/6/21 Matthew Dillon <[email protected]>: > I've made some fairly straightforward changes to HAMMER in HEAD, but > they need testing. > .... > I also made a minor change to cpdup to not use temporary filenames > when doing a fresh copy (when the target file does not exist). To test > HAMMER with cpdup you need the new cpdup. The old cpdup always creates > a temporary file and then rename()'s and that unfortunately breaks the > optimization that HAMMER makes to order the inode numbers.
Just not sure was it the right decision. AFAIU, tmpname->rename was there because of atomicity of file operation, so the file with correct name appear fully written. Direct file creation sure improve performance with your changes, but afraid, could lead to race conditions if someone is working with files cpdup is creating right now. I'm talking about chances to read partially copied files. It should be Ok for backup (unless unexpected power down), but definitely not ok for mirroring (and serving mirrored files). Or, I could misread your post. -- Dennis Melentyev
