Subject: Re: problem with tmpfs and linux emulation?
To: Steven M. Bellovin <smb@cs.columbia.edu>
From: Jaromir Dolecek <jdolecek@NetBSD.org>
List: current-users
Date: 11/12/2005 20:27:46
On Sat, Nov 12, 2005 at 02:01:46PM -0500, Steven M. Bellovin wrote:
> The symptom is that some applications -- I'm seeing it with openoffice2 
> -- can't read tmpfs directories via linux emulation.  A posting by Thor 
> summarizes it:

Aha - so is the problem that Linux glibs reads the directory
entries via read(2) rather then using getdents()? Oh my god.
I thought they fixed it long ago - it's still present in glibc
on SuSE 9.1?????

If that is the problem, there is no other way then to add
a read(2) emulation wrapper for Linux as suggested.
 
Jaromir

> Subject: Re: problem with tmpfs and linux emulation?
> From: Thor Lancelot Simon <tls@rek.tjls.com>
> Date: Wed, 9 Nov 2005 10:48:41 -0500
> To: "Steven M. Bellovin" <smb@cs.columbia.edu>
> Cc: current-users@netbsd.org
> 
> On Wed, Nov 09, 2005 at 10:40:21AM -0500, Steven M. Bellovin wrote:
> > 
> > What, precisely, is the problem?  What is there about tmpfs that a 
> > application can detect?
> 
> Linux's libc relies on knowledge of the internal structure of directory
> entries rather than manipulating them with the appropriate system calls.
> This causes chaos for those porting filesystems to Linux (e.g. XFS, JFS),
> as well as for those emulating Linux on other systems (e.g. us) or serving
> directories to Linux over network filesystems (because the Linux clients
> don't translate the structure of directories on read(2) either).
> 
> We don't encounter this problem with most local filesystems because the
> in-core directory data structures used by UFS are "close enough".  But
> we have a nasty hack to work around it for NFS (which has a performance
> impact, as well as a significant code complexity impact) and we have
> trouble with filesystems that can't trivially provide directory structures
> that look like Linux libc wants them to.
> 
> I have always wondered what Linux does with foreign filesystems like FAT
> and NTFS.  I assume that if you try to read a directory, their kernel just
> lies.
> 
> 
> 		--Steven M. Bellovin, http://www.cs.columbia.edu/~smb

-- 
Jaromir Dolecek <jdolecek@NetBSD.org>            http://www.NetBSD.cz/
-=- We can walk our road together if our goals are all the same;     -=-
-=- We can run alone and free if we pursue a different aim.          -=-