When using samba after having implemented quotas: [2006/01/18 05:50:03, 3] lib/sysquotas.c:sys_get_quota(413) sys_get_vfs_quota() failed for mntpath[/test] bdev[/dev/VolGroup01/testlv] qtype[2] id[10056]: Invalid argument [2006/01/18 05:50:03, 3] smbd/reply.c:reply_dskattr(785) dskattr dfree=58104 [2006/01/18 05:50:03, 5] lib/util.c:show_msg(486) [2006/01/18 05:50:03, 5] lib/util.c:show_msg(496) To be able to support both quota v1 and v2, samba is defined its own constants for the cmd part of quotactl()'s QCMD. However, the v2 constants in the system headers and samba don't match. In source/include/samba_linux_quota.h: #ifndef Q_V2_GETQUOTA #define Q_V2_GETQUOTA 0x0D00 #endif #ifndef Q_V2_SETQUOTA #define Q_V2_SETQUOTA 0x0E00 #endif And in sys/quota.h: # define Q_GETQUOTA 0x800007 /* get user quota structure */ # define Q_SETQUOTA 0x800008 /* set user quota structure */
Created attachment 1710 [details] samba-unbreak-v2-quota-support.patch
The patch will break 2.4 kernels. We probably shouldn't be redefining the macros anyways.
Why would it break 2.4 kernels? Those values shouldn't have changed, at least not for quota v2. But if there was a change in the v2 constants in the course of the 2.4 kernels, then: In sys/quota.h: /* * Select between different incompatible quota versions. * Default to the version used by Linux kernel version 2.4.21 * or earlier (in RHEL version 1 is AS2.1, version 2 is RHEL3 and later). */ Another way is to define _LINUX_QUOTA_VERSION in source/include/samba_linux_quota.h and #define Q_V2_GETQUOTA Q_GETQUOTA
For a 2.4 kernel we have: #define Q_GETQUOTA 0x0300 /* get limits and usage */ #define Q_SETQUOTA 0x0400 /* set limits and usage */ For a 2.6 kernel we have: #define Q_GETQUOTA 0x800007 /* get user quota structure */ #define Q_SETQUOTA 0x800008 /* set user quota structure */ Therefore I suggest the following check done by configure: a) If we have linux/include/linux/quota.h, then exract the values and use them. b) If not, us the current Linux kernel values.
(In reply to comment #4) > For a 2.4 kernel we have: > #define Q_GETQUOTA 0x0300 /* get limits and usage */ > #define Q_SETQUOTA 0x0400 /* set limits and usage */ > > For a 2.6 kernel we have: > #define Q_GETQUOTA 0x800007 /* get user quota structure */ > #define Q_SETQUOTA 0x800008 /* set user quota structure */ That's not the differences between kernels that you're showing, but the differences between versions of the Linux quotas. $ grep Q_GETQUOTA /usr/include/sys/quota.h # define Q_GETQUOTA 0x0300 /* get limits and usage */ # define Q_GETQUOTA 0x800007 /* get user quota structure */ From what I can see 0x0D00 and 0x0E00 were never values for Q_V2_GETQUOTA and Q_V2_SETQUOTA, in any of the 2 versions of the Linux quotas.
Bastien: even if this is a very old bug report, can you say what exactly does not work for you? I just tested Linux quota support with ext3 with good old version 1 quota format and with version 2 (journaled) quota enabled on a 3.5 kernel. Both seems to work as expected.
(In reply to comment #6) > Bastien: even if this is a very old bug report, can you say what exactly does > not work for you? Quotas don't work, I get warnings in the log messages. > I just tested Linux quota support with ext3 with good old > version 1 quota format and with version 2 (journaled) quota enabled on a 3.5 > kernel. Both seems to work as expected. You would have asked me that 6 years ago, I might have been able to answer you. As it is, I don't care anymore. I'm sure the customer this was intended to has moved on, or is happy with the distribution patch.
(In reply to comment #7) > Quotas don't work, I get warnings in the log messages. I told you that it worked for me with v1 and v2 quotas and ext3. If it doesn't for you, please describe in detail what does not work for you and attach level 10 log files. > You would have asked me that 6 years ago, I might have been able to answer you. > As it is, I don't care anymore. I'm sure the customer this was intended to has > moved on, or is happy with the distribution patch. don't blame a free community if you have unhappy customers. That's what http://www.samba.org/samba/support/ is for.
(In reply to comment #8) > (In reply to comment #7) > > Quotas don't work, I get warnings in the log messages. > > I told you that it worked for me with v1 and v2 quotas and ext3. If it doesn't > for you, please describe in detail what does not work for you and attach level > 10 log files. 6 YEARS! I'm not reinstalling RHEL3, sorry. > > You would have asked me that 6 years ago, I might have been able to answer you. > > As it is, I don't care anymore. I'm sure the customer this was intended to has > > moved on, or is happy with the distribution patch. > > don't blame a free community if you have unhappy customers. That's what > http://www.samba.org/samba/support/ is for. I don't have unhappy customers, I'm unhappy that a valid patch is getting dismissed.
Bastien: stop playing a mortally offended kid and stop closing a bugs as WONTFIX that you say that are still valid, please. Instead of grousing around, please show us what is going wrong in your setup.
I see no more quota issues on linux with 4.0 and upcoming 3.6. Thanks for your help.