Subject: Re: problem with tmpfs and linux emulation?
To: Matt Thomas <matt@3am-software.com>
From: Steven M. Bellovin <smb@cs.columbia.edu>
List: current-users
Date: 11/12/2005 13:59:26
In message <43763B07.1030204@3am-software.com>, Matt Thomas writes:
>Steven M. Bellovin wrote:
>> In message <437637E2.6010101@3am-software.com>, Matt Thomas writes:
>> 
>>>Bill Studenmund wrote:
>>>
>>>I don't see the problem.  Instead of using sys_read, linux would have its
>>>linux_sys_read.  It would look up the fd, see if it's a DTYPE_VNODE, and if 
>so
>>>check to see if it's a directory.  It's only a problem is you are relying on
> t
>>>he standard sys_read routine.
>> 
>> 
>> Presumably, though, the behavior of linux_sys_read would have to depend 
>> on the underlying file system type -- it does the right thing for, say, 
>> ffs and ext2fs, but not for tmpfs.
>
>But it only work by "accident", not intention.  This method should be used for
>all filesystems, not just tmpfs.  It's a bit more inefficient, but more correc
>t.

I agree, with one caveat: would the linux_sys_read layer have enough 
information to fix things, regardless of the semantics of the 
underlying file system?  If not, we have a lot of file systems to fix 
to pass the proper information up to the emulation layer.

		--Steven M. Bellovin, http://www.cs.columbia.edu/~smb