From owner-freebsd-bugs Sun Jul 9 4: 0: 9 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 911D137B5D9 for ; Sun, 9 Jul 2000 04:00:05 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id EAA24409; Sun, 9 Jul 2000 04:00:05 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Sun, 9 Jul 2000 04:00:05 -0700 (PDT) Message-Id: <200007091100.EAA24409@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Robert Drehmel Subject: Re: bin/19772: df output wrong for union-mounts Reply-To: Robert Drehmel Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR bin/19772; it has been noted by GNATS. From: Robert Drehmel To: freebsd-gnats-submit@FreeBSD.org Cc: bdluevel@heitec.net Subject: Re: bin/19772: df output wrong for union-mounts Date: Sun, 09 Jul 2000 12:54:32 +0200 This is a multi-part message in MIME format. --------------F4ADB7FBFEE0C8F7415DC772 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit > 'df -t nonfs' lists, if two partitions are mounted > to the same mountpoint with 'union', one of them > twice and omits the other. 'df' by itself lists both, > as expected. > This also affects the "daily" report to root, > /etc/periodic/daily/400.status-disks Use df -n or take this patch. I'm not quite sure for what the statfs(2) call down in regetmntinfo() is. statfs(2) takes the path and a ``struct statfs´´ buffer as arguments; it can not distinguish between two identical paths (who can? :-), so the information about the last filesystem mounted on that path is written into the buffer. Or am I wrong ? Anyway, the patch works for me... -- Robert S. F. Drehmel linux.de: "Forget Ctrl-Alt-Del, use Linux" Right, their productivity seems to be the same. --------------F4ADB7FBFEE0C8F7415DC772 Content-Type: text/plain; charset=us-ascii; name="df.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="df.diff" *** ../df.c Sun Jul 9 12:11:07 2000 --- df.c Sun Jul 9 12:09:23 2000 *************** *** 296,304 **** for (j = 0, i = 0; i < mntsize; i++) { if (checkvfsname(mntbuf[i].f_fstypename, vfslist)) continue; ! if (!nflag) ! (void)statfs(mntbuf[i].f_mntonname,&mntbuf[j]); ! else if (i != j) mntbuf[j] = mntbuf[i]; j++; } --- 296,302 ---- for (j = 0, i = 0; i < mntsize; i++) { if (checkvfsname(mntbuf[i].f_fstypename, vfslist)) continue; ! if (i != j) mntbuf[j] = mntbuf[i]; j++; } --------------F4ADB7FBFEE0C8F7415DC772-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message