12 Nov
2009
12 Nov
'09
7:32 p.m.
On Thu, 2009-11-12 at 16:22 -0800, Jordan Tardif wrote:
I guess the easiest solution would be to:
- Remove the duplicate detection/fixing code from Dovecot code.
- Create a script that resolves duplicates by deleting one of them.
So if I do #1 , do you see this causing any other problems with dovecot?
I actually meant that you should do both. But no, 1) shouldn't cause problems.
Or actually looking at the code, it already tries to detect duplicate hard links and unlinks one of them. You could change the code from:
if (st1.st_ino == st2.st_ino &&
CMP_DEV_T(st1.st_dev, st2.st_dev)) {
/* Files are the same. this means either a race condition
between stat() calls, or that the files were link()ed. */
if (st1.st_nlink > 1 && st2.st_nlink == st1.st_nlink &&
st1.st_ctime == st2.st_ctime &&
st1.st_ctime < ioloop_time - DUPE_LINKS_DELETE_SECS) {
to just something like:
if (st1.st_size == st2.st_size) {
and then some day when your migrations are done switch it back.