From owner-freebsd-current Sun Oct 17 19:55:12 1999 Delivered-To: freebsd-current@freebsd.org Received: from gizmo.internode.com.au (gizmo.internode.com.au [192.83.231.115]) by hub.freebsd.org (Postfix) with ESMTP id 1533114D49; Sun, 17 Oct 1999 19:55:00 -0700 (PDT) (envelope-from newton@gizmo.internode.com.au) Received: (from newton@localhost) by gizmo.internode.com.au (8.9.3/8.9.3) id MAA73538; Mon, 18 Oct 1999 12:23:59 +0930 (CST) (envelope-from newton) From: Mark Newton Message-Id: <199910180253.MAA73538@gizmo.internode.com.au> Subject: Re: duplicate filenames under Linux emulation To: ak@freenet.co.uk (Alex) Date: Mon, 18 Oct 1999 12:23:58 +0930 (CST) Cc: kurt@boolean.net, freebsd-emulation@FreeBSD.ORG, freebsd-current@FreeBSD.ORG In-Reply-To: <380A9278.638D7FC2@freenet.co.uk> from "Alex" at Oct 18, 99 03:22:32 am X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Alex wrote: > 444964 -rw-r--r-- 1 ak users 102042 Oct 17 20:23 > bxutils-c.c > 444964 -rw-r--r-- 1 ak users 102042 Oct 17 20:23 > bxutils-c.c For what it's worth, I have this bug in the to-do list for the SVR4 emulator too. It's caused by the fact that dirent structures for BSD and SysVR4 are of different sizes, so svr4_getdents() (and svr4_getdents64(), its 64-bit counterpart) fetches a buffer full of BSD dirent structures from disk (usually more than the number which have actually been requested) with VOP_READDIR(), rewrites them into another buffer full of svr4_dirent structures, and returns the contents of the second buffer to userspace. Next time getdents() is called the emulated version continues from where it left off in the first buffer until it has been exhaused, at which point it issues another VOP_READDIR() call to refresh it. It looks like the duplicates are the entries which appear on the boundaries of the buffer first buffer (i.e.: the last directory entry in a buffer will be re-read into the beginning of the buffer when VOP_READDIR() is called again). I haven't had time to examine it in detail, but I suspect that incrementing an offset parameter for VOP_READDIR() aio request will fix this bug. If it does, let me know and I'll fold the result into svr4_getdents() as well :-) - mark ---- Mark Newton Email: newton@internode.com.au (W) Network Engineer Email: newton@atdot.dotat.org (H) Internode Systems Pty Ltd Desk: +61-8-82232999 "Network Man" - Anagram of "Mark Newton" Mobile: +61-416-202-223 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message