On 11-Apr-2002 Dan Nelson wrote:
> In the last episode (Apr 11), Michael R. Wayne said:
>> Now - to re-iterate my point.  The code for edquota FAILS IN EXACTLY
>> THE SAME WAY with EINVAL.  But edquota IGNORES this error.  The
>> reason that edquota works is that, when it gets this failure, it
>> reads and writes the quota file directly.  If quotactl works
>> properly, why is there code in edquota.c to read/write the quotactl
>> file directly?
>> 
>> /usr/src/usr.sbin/edquota/edquota.c 
>> 
>> if (quotactl(fs->fs_file, qcmd, id, &qup->dqblk) != 0) {
>>      if (errno == EOPNOTSUPP && !warned) {                   <--- running
through gdb errno is
>>      EINVAL here.
>>              warned++;
>>              warnx("warning: quotas are not compiled into this kernel");
>>              sleep(3);
>>      }
>>      if ((fd = open(qfpathname, O_RDONLY)) < 0) {            <--- So,
edquota ignores
>>      quotactl and does it manually
> 
> Note the warnx() call.  It writes directly to the quota file so you can
> set quotas even if your current kernel is not capable of enforcing
> them.  Is your kernel compiled with "options QUOTA"?  I can tell you on
> all my 4.* systems (4.0 through 4.5) edquota calls quotactl and it
> succeeds:
> 
>  90883 edquota  CALL  quotactl(0x8057828,0x40000,0x3e8,0x8057808)
>  90883 edquota  NAMI  "/usr"
>  90883 edquota  RET   quotactl 0

He didn't get EOPNOTSUPP, he got EINVAL.  Perhaps it is a bug in edquota
to edit the quota file directly for an errno other than EOPNOTSUPP?

-- 

John Baldwin <[EMAIL PROTECTED]>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to