From owner-freebsd-hackers Thu Apr 11 14:10:48 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by hub.freebsd.org (Postfix) with ESMTP id E7C9237B416 for ; Thu, 11 Apr 2002 14:10:43 -0700 (PDT) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.12.2/8.12.2) with ESMTP id g3BLAbGS017492; Thu, 11 Apr 2002 16:10:41 -0500 (CDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.2/8.12.2/Submit) id g3BLAbTI017491; Thu, 11 Apr 2002 16:10:37 -0500 (CDT) Date: Thu, 11 Apr 2002 16:10:37 -0500 From: Dan Nelson To: "Michael R. Wayne" Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: quotactl issues Message-ID: <20020411211037.GA8982@dan.emsphone.com> References: <200204101733.NAA65972@manor.msen.com> <20020411132409.J56996@staff.msen.com> <3CB5F6A8.BBD071D@mindspring.com> <20020411170324.K56996@staff.msen.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020411170324.K56996@staff.msen.com> User-Agent: Mutt/1.3.28i X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error 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 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 -- Dan Nelson dnelson@allantgroup.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message