[Dovecot] fs quota - what I am doing wrong?
Hi everyone, on my server, i have quota set on /home partition (ext3). mount says:
root@zen:/var/log# mount |grep quo /dev/sda8 on /home type ext3 (rw,noatime,usrquota) /dev/sda7 on /tmp type ext3 (rw,noatime,usrquota,data=writeback)
System is debian/stable (distribution 2.6.8-3-686-smp kernel), quotas are working:
root@zen:/var/log# quota ax Disk quotas for user ax (uid 506): Filesystem blocks quota limit grace files quota limit grace /dev/sda8 148064 250000 300000 7066 0 0 /dev/sda7 16 10000 300000 5 0 0
but dovecot has trouble with them:
root@zen:/var/log# grep ax mail.err |tail -n 4 Feb 26 15:02:27 zen dovecot: IMAP(ax): quotactl(Q_GETQUOTA, /dev/sda8) failed: Invalid argument Feb 26 15:02:27 zen dovecot: IMAP(ax): Dovecot was compiled with Linux quota v2 support, try changing it (--with-linux-quota configure option) Feb 26 15:03:28 zen dovecot: IMAP(ax): quotactl(Q_GETQUOTA, /dev/sda8) failed: Invalid argument Feb 26 15:03:28 zen dovecot: IMAP(ax): Dovecot was compiled with Linux quota v2 support, try changing it (--with-linux-quota configure option)
In sheer desperation I compiled dovecot with v1 quotas, but that fails too. Can anyone point me into right direction?
Ax
Václav Hůla, správce unixových serverů Přírodovědecká fakulta Univerzita Karlova v Praze
On Mon, 2007-02-26 at 15:06 +0100, Václav Hůla wrote:
Feb 26 15:02:27 zen dovecot: IMAP(ax): quotactl(Q_GETQUOTA, /dev/sda8) failed: Invalid argument Feb 26 15:02:27 zen dovecot: IMAP(ax): Dovecot was compiled with Linux quota v2 support, try changing it (--with-linux-quota configure option)
Maybe the quota headers aren't matching what the kernel is running. I've no idea really, the fs quota code either seems to work or it doesn't..
You could try checking with strace what's the difference between Dovecot's quotactl() call and "quota" command's quotactl() call.
Timo Sirainen napsal(a):
On Mon, 2007-02-26 at 15:06 +0100, Václav Hůla wrote:
Feb 26 15:02:27 zen dovecot: IMAP(ax): quotactl(Q_GETQUOTA, /dev/sda8) failed: Invalid argument Feb 26 15:02:27 zen dovecot: IMAP(ax): Dovecot was compiled with Linux quota v2 support, try changing it (--with-linux-quota configure option)
Maybe the quota headers aren't matching what the kernel is running. I've no idea really, the fs quota code either seems to work or it doesn't..
You could try checking with strace what's the difference between Dovecot's quotactl() call and "quota" command's quotactl() call.
The difference:
quota command: quotactl(Q_GETFMT|USRQUOTA, "/dev/sda8", 0, 0xbffff218) = 0
dovecot: quotactl(Q_GETQUOTA|USRQUOTA, "/dev/sda8", 506, {0, 135145272, 1075193885, 1075193885, 135145168, 135099456, 3221217528, 134953542}) = -1 EINVAL (Invalid argument)
I found quotactl in 3 places in /usr/include:
/usr/include/linux/quota.h long quotactl __P ((unsigned int, const char *, int, caddr_t));
/usr/include/sys/quota.h extern int quotactl (int __cmd, const char *__special, int __id, caddr_t __addr) __THROW;
/usr/include/linux/security.h int (*quotactl) (int cmds, int type, int id, struct super_block * sb);
To me it looks that dovecot uses the linux/security one, but sadly I have no idea why or how to stop it.
Hula
Václav Hůla, správce unixových serverů Přírodovědecká fakulta Univerzita Karlova v Praze
On Thu, 2007-03-01 at 10:05 +0100, Václav Hůla wrote:
quota command: quotactl(Q_GETFMT|USRQUOTA, "/dev/sda8", 0, 0xbffff218) = 0
dovecot: quotactl(Q_GETQUOTA|USRQUOTA, "/dev/sda8", 506, {0, 135145272, 1075193885, 1075193885, 135145168, 135099456, 3221217528, 134953542}) = -1 EINVAL (Invalid argument) .. /usr/include/sys/quota.h extern int quotactl (int __cmd, const char *__special, int __id, caddr_t __addr) __THROW;
Actually Dovecot's quotactl() call looks correct to me. Q_GETFMT is something different. Did you give user parameter to quota command while straceing it?
Timo Sirainen napsal(a):
On Thu, 2007-03-01 at 10:05 +0100, Václav Hůla wrote:
quota command: quotactl(Q_GETFMT|USRQUOTA, "/dev/sda8", 0, 0xbffff218) = 0
dovecot: quotactl(Q_GETQUOTA|USRQUOTA, "/dev/sda8", 506, {0, 135145272, 1075193885, 1075193885, 135145168, 135099456, 3221217528, 134953542}) = -1 EINVAL (Invalid argument) .. /usr/include/sys/quota.h extern int quotactl (int __cmd, const char *__special, int __id, caddr_t __addr) __THROW;
Actually Dovecot's quotactl() call looks correct to me. Q_GETFMT is something different. Did you give user parameter to quota command while straceing it?
Yes but it does not make much difference:
ax@zen:~$ strace /usr/bin/quota 2>&1 |grep quotactl quotactl(Q_XGETQSTAT|USRQUOTA, NULL, 0, NULL) = -1 EFAULT (Bad address) quotactl(Q_GETFMT|USRQUOTA, "/dev/sda8", 0, 0xbfffe778) = 0 quotactl(Q_GETINFO|USRQUOTA, "/dev/sda8", 0, 0xbfffe6f0) = 0 quotactl(Q_GETFMT|USRQUOTA, "/dev/sda7", 0, 0xbfffe778) = 0 quotactl(Q_GETINFO|USRQUOTA, "/dev/sda7", 0, 0xbfffe6f0) = 0 quotactl(Q_GETQUOTA|USRQUOTA, "/dev/sda8", 506, 0xbfffe5f0) = 0 quotactl(Q_GETQUOTA|USRQUOTA, "/dev/sda7", 506, 0xbfffe5f0) = 0
ax@zen:~$ strace /usr/bin/quota ax 2>&1 |grep quotactl quotactl(Q_XGETQSTAT|USRQUOTA, NULL, 0, NULL) = -1 EFAULT (Bad address) quotactl(Q_GETFMT|USRQUOTA, "/dev/sda8", 0, 0xbfffe078) = 0 quotactl(Q_GETINFO|USRQUOTA, "/dev/sda8", 0, 0xbfffdff0) = 0 quotactl(Q_GETFMT|USRQUOTA, "/dev/sda7", 0, 0xbfffe078) = 0 quotactl(Q_GETINFO|USRQUOTA, "/dev/sda7", 0, 0xbfffdff0) = 0 quotactl(Q_GETQUOTA|USRQUOTA, "/dev/sda8", 506, 0xbfffdef0) = 0 quotactl(Q_GETQUOTA|USRQUOTA, "/dev/sda7", 506, 0xbfffdef0) = 0
root@zen:~# strace /usr/bin/quota 2>&1 |grep quotactl quotactl(Q_XGETQSTAT|USRQUOTA, NULL, 0, NULL) = -1 EFAULT (Bad address) quotactl(Q_GETFMT|USRQUOTA, "/dev/sda8", 0, 0xbffff398) = 0 quotactl(Q_GETINFO|USRQUOTA, "/dev/sda8", 0, 0xbffff310) = 0 quotactl(Q_GETFMT|USRQUOTA, "/dev/sda7", 0, 0xbffff398) = 0 quotactl(Q_GETINFO|USRQUOTA, "/dev/sda7", 0, 0xbffff310) = 0 quotactl(Q_GETQUOTA|USRQUOTA, "/dev/sda8", 0, 0xbffff210) = 0 quotactl(Q_GETQUOTA|USRQUOTA, "/dev/sda7", 0, 0xbffff210) = 0
root@zen:~# strace /usr/bin/quota ax 2>&1 |grep quotactl quotactl(Q_XGETQSTAT|USRQUOTA, NULL, 0, NULL) = -1 EFAULT (Bad address) quotactl(Q_GETFMT|USRQUOTA, "/dev/sda8", 0, 0xbfffec18) = 0 quotactl(Q_GETINFO|USRQUOTA, "/dev/sda8", 0, 0xbfffeb90) = 0 quotactl(Q_GETFMT|USRQUOTA, "/dev/sda7", 0, 0xbfffec18) = 0 quotactl(Q_GETINFO|USRQUOTA, "/dev/sda7", 0, 0xbfffeb90) = 0 quotactl(Q_GETQUOTA|USRQUOTA, "/dev/sda8", 506, 0xbfffea90) = 0 quotactl(Q_GETQUOTA|USRQUOTA, "/dev/sda7", 506, 0xbfffea90) = 0
for full strace of last command see http://www.natur.cuni.cz/~ax/strace.quota.user
Hula
Václav Hůla, správce unixových serverů Přírodovědecká fakulta Univerzita Karlova v Praze
On Thu, 2007-03-01 at 11:25 +0100, Václav Hůla wrote:
dovecot: quotactl(Q_GETQUOTA|USRQUOTA, "/dev/sda8", 506, {0, 135145272, 1075193885, 1075193885, 135145168, 135099456, 3221217528, 134953542}) = -1 EINVAL (Invalid argument) .. quotactl(Q_GETQUOTA|USRQUOTA, "/dev/sda8", 506, 0xbfffe5f0) = 0
What about "strace -e raw=quotactl". I think the first parameter is different even though it expands it to the same names in both cases. If they are different, you could try what happens if you change QCMD(Q_GETQUOTA, USRQUOTA) in quota-fs.c to the value given by strace quota.
Hi
El Lunes, 26 de Febrero de 2007 15:06, Václav Hůla escribió:
root@zen:/var/log# grep ax mail.err |tail -n 4 Feb 26 15:02:27 zen dovecot: IMAP(ax): quotactl(Q_GETQUOTA, /dev/sda8) failed: Invalid argument Feb 26 15:02:27 zen dovecot: IMAP(ax): Dovecot was compiled with Linux quota v2 support, try changing it (--with-linux-quota configure option) Feb 26 15:03:28 zen dovecot: IMAP(ax): quotactl(Q_GETQUOTA, /dev/sda8) failed: Invalid argument Feb 26 15:03:28 zen dovecot: IMAP(ax): Dovecot was compiled with Linux quota v2 support, try changing it (--with-linux-quota configure option)
In sheer desperation I compiled dovecot with v1 quotas, but that fails too. Can anyone point me into right direction?
May be a silly idea, but have you forced quota v2 support? I had a similar problem -I can't remeber if exactly the same, though-, and solved it with --with-linux-quota=2. Try it.
Aaaaaaaaaagur.
Joseba Torre. CIDIR Bizkaia.
participants (3)
-
Joseba Torre
-
Timo Sirainen
-
Václav Hůla