[Dovecot] Avoiding Hardlinks (was: Something other than dotlock for uidlist locking?)

James Berry james at jberry.us
Wed Aug 9 23:44:25 EEST 2006

Hey Timo,

Thanks again for all the work you do on DoveCot. I'd like to put  
together a patch to avoid use of hardlinks on Mac OS X. It definitely  
looks doable. (a couple of questions below...)

On Aug 8, 2006, at 6:16 PM, James Berry wrote:
> On Aug 8, 2006, at 5:43 PM, James Berry wrote:
>> Hi Timo, (By the way, this seems to relate to a performance issue  
>> on Mac OS X with HFS+).
> I think the problem may be more general than this particular case.  
> This fix speeds up some accesses, but there are still bottlenecks,  
> I believe. I have a feeling the performance issues will manifest in  
> any cases where hardlinks are used heavily.
> Can you tell me, Timo, in what other cases hard links are used  
> (file copy, seemingly being one) and whether there is any way to  
> turn them off or rework the code to avoid them?

In seaching the code for "link(", I find only four affected files/ 
cases. Here I look into possible implementations for a patch to  
AVOID_HARDLINKS. Such a patch would dramatically improve performance  
on Mac OS X with the HFS+ filesystem.

Timo, would you mind commenting on these to make sure my  
understanding is correct? And for the last one, I need a suggestion  
on how to proceed.

file-copy.c:  [EASY]

	Looks like it would be easy to take the already coded case for when  
try_hardlink is false.

file-dotlock.c: [EASY]

	In dotlock_create, use try_create_lock_excl rather than  

maildir-copy.c: [LOOKS EASY]

	In maildir_copy(), take the fallback case using mail_storage_copy.

maildir-save.c: [NEED HELP]

	In maildir_file_move(), there seems to be no fallback case, and I'm  
unsure of the desired  symantics, so I could use some suggestions  
here: can we just fall back into something like the code in file-copy.c?

Thanks for your thoughts!


More information about the dovecot mailing list