From: Blaisorblade <bla...@ya...> - 2004-11-02 22:28:08
|
On Tuesday 26 October 2004 19:34, BlaisorBlade wrote: > On Tuesday 26 October 2004 18:36, BlaisorBlade wrote: > > On Tuesday 26 October 2004 19:09, Jeff Dike wrote: > > > bla...@ya... said: > > > > But sorry, how do you manage to use COW files? It's quite hard, > > > > since the code does not even compile currently, to my knowledge. > > > > > > What are you talking about? COW files have always worked and have > > > never been broken. > > > > That's fine, but the support is quite buggy: I'd like to undo this sentence... > > 1) Any change which is done is lost (reported and confirmed). I remember > > digging into this some time ago, and maybe it came out that only little > > changes get lost. I tried changing the root password on the > > root_fs_tomsbrt and the change got lost after exiting from the VM and > > restarting it. > > I can confirm this issue with 2.6 kernels. To show this, however, you need > to edit a file which already exists in the backing file, as /etc/passwd. > I've tested this with root_fs_tomsbrt. Well, this is false. It happens, in fact, even without COW files, and because /etc/passwd is rewritten during shutdown by that FS's scripts! So I am foolish :-000 . Please tell this all over the world! > > 2) Creating a COW directly from the command line does not work. > > There is > > an error in the failure path, of the kind "errno / -return value": > With the current kernels I'm testing (2.6.9 rc ones), this does not happen. > The fix below does still make sense, however. > > diff -puN arch/um/drivers/ubd_kern.c~uml-start-fixing-ubd > > arch/um/drivers/ubd_kern.c > > --- linux-2.6.9-current/arch/um/drivers/ubd_kern.c~uml-start-fixing-ubd > > 2004-10-17 18:03:54.158938784 +0200 > > +++ linux-2.6.9-current-paolo/arch/um/drivers/ubd_kern.c > > 2004-10-17 18:17:49.071012856 +0200 > > @@ -1394,7 +1394,7 @@ int open_ubd_file(char *file, struct ope > > if((fd == -ENOENT) && (create_cow_out != NULL)) > > *create_cow_out = 1; > > if(!openflags->w || > > - ((errno != EROFS) && (errno != EACCES))) > > return(-errno); + ((fd != -EROFS) && (fd != -EACCES))) > > return(fd); openflags->w = 0; > > fd = os_open_file(file, *openflags, mode); > > if(fd < 0) > > > > (Note that the patch is probably against ubd_user.c, actually. In my > > tree, I've almost completely moved it in ubd_kern.c). Ok - this is another problem, less foolish. Actually, moving the code from ubd_user.c to ubd_kern.c *should* work. However, it does not when referring to "errno". The kernel files are compiled with -Derrno=kernel_errno; while ubd_user should use the os_* functions return value, it can use errno without failure. I'll fix that. > > 3) Even with that applied, I got complaints from absolutize(). This is a problem from the shell: it does not expand the "~" in the backing file name, when using COW files. I'm fixing that by using ":" as separator for this case (which is understood by the shell; this requires fixing UML to understand this delimiter, which is a trivial fix). However, there is a real problem (which is less important, however): when the COW file is empty, UML does not fill it in. Bye -- Paolo Giarrusso, aka Blaisorblade Linux registered user n. 292729 |