From owner-freebsd-hackers Thu Apr 11 19:12:38 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.speakeasy.net (mail11.speakeasy.net [216.254.0.211]) by hub.freebsd.org (Postfix) with ESMTP id 44E3537B41D for ; Thu, 11 Apr 2002 19:12:04 -0700 (PDT) Received: (qmail 25272 invoked from network); 12 Apr 2002 02:12:02 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail11.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 12 Apr 2002 02:12:02 -0000 Received: from laptop.baldwin.cx (john@laptop.baldwin.cx [192.168.0.4]) by server.baldwin.cx (8.11.6/8.11.6) with ESMTP id g3C2Csv58904; Thu, 11 Apr 2002 22:12:54 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20020411211037.GA8982@dan.emsphone.com> Date: Thu, 11 Apr 2002 22:11:22 -0400 (EDT) From: John Baldwin To: Dan Nelson Subject: Re: quotactl issues Cc: freebsd-hackers@FreeBSD.ORG, "Michael R. Wayne" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 <>< 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