Date: Thu, 11 Apr 2002 22:11:22 -0400 (EDT) From: John Baldwin <jhb@FreeBSD.org> To: Dan Nelson <dnelson@allantgroup.com> Cc: freebsd-hackers@FreeBSD.ORG, "Michael R. Wayne" <wayne@staff.msen.com> Subject: Re: quotactl issues Message-ID: <XFMail.20020411221122.jhb@FreeBSD.org> In-Reply-To: <20020411211037.GA8982@dan.emsphone.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <jhb@FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20020411221122.jhb>