All of lore.kernel.org
 help / color / mirror / Atom feed
* [uml-devel] hostfs oddities
@ 2008-07-05 18:46 Ingo van Lil
  2008-07-07 20:39 ` Jeff Dike
  0 siblings, 1 reply; 6+ messages in thread
From: Ingo van Lil @ 2008-07-05 18:46 UTC (permalink / raw)
  To: user-mode-linux-devel

Hi there,

I noticed two little misfeatures in the hostfs file system. The first 
one is most certainly a bug, the second one might be functioning as 
intended.

1. If a file is held read-only by one process it cannot by creat()'ed by 
another one:

   [root@localhost ~]# mount -t hostfs none /mnt
   [root@localhost ~]# cd /mnt/tmp
   [root@localhost tmp]# touch foo
   [root@localhost tmp]# tail -f foo &
   [1] 895
   [root@localhost tmp]# > foo
   -bash: foo: Invalid argument
   [root@localhost tmp]# kill 895
   [1]+  Terminated              tail -f foo
   [root@localhost tmp]# > foo

I tracked that problem down to the set_attr() function in hostfs_user.c: 
It tries to ftruncate() the read-only file descriptor. The file should 
be re-opened writable before changing its length.

2. As long as a file is held open changes made outside the UML kernel 
(i.e. on the host side) may not be visible:

   [root@localhost tmp]# tail -f foo &
   [1] 897
   # Host system: echo "Hello World" > /tmp/foo
   [root@localhost tmp]# cat foo
   [root@localhost tmp]# kill 897
   [1]+  Terminated              tail -f foo
   [root@localhost tmp]# cat foo
   Hello World

I guess this is some kind of caching effect, because strace shows that 
there is only a single read to the actual physical file. Maybe hostfs 
should check whether the outside file has changed and invalidate the 
cache if necessary.

Cheers,
Ingo

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-07-10 17:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-05 18:46 [uml-devel] hostfs oddities Ingo van Lil
2008-07-07 20:39 ` Jeff Dike
2008-07-08 14:15   ` Ingo van Lil
2008-07-10 17:37     ` Jeff Dike
2008-07-09 19:43   ` Ingo van Lil
2008-07-10 17:28     ` Jeff Dike

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.