On 5.8.2013, at 19.46, Francesco Prelz <Francesco.Prelz@mi.infn.it> wrote:
on a clustered Dovecot server installation that was recently moved from a shared GPFS filesystem to GFS2, occasional corruptions in the users' INBOXes started appearing, where a new incoming message would be appended directly after a block of NUL bytes, and be scanned by dovecot as being glued to the preceding message.
I traced this to the file extension operation performed in mbox_sync_handle_eof_updates, where the 'file_set_size' call is used. If available, file_set_size will use the posix_fallocate call. In GFS2 posix_fallocate increases the file size in 4 kB chunks (there seems to be no guarantee anyway that posix_allocate will extend a file by the exact size requested).
I think that's a bug in GFS2. I understand posix_fallocate() man page to clearly say that it grows the file to the specified offset+len, not any higher. So could be a good idea to report it to their developers if they're not aware of it..
Anyway, I thought I'd just get rid of the whole syscall since it's not very useful anyway: http://hg.dovecot.org/dovecot-2.2/rev/42b2736f146b