From: Marcin P. <wa...@op...> - 2004-04-13 21:23:32
|
Hello, My UML fails to reboot saying: #v+ F_SETLK failed, file already locked by pid 32589 Failed to lock 'fs', err = 11 #v- or when .cow file is used: #v+ F_SETLK failed, file already locked by pid 7530 Failed to lock 'root_fs.cow', err = 11 unable to open root_fs.cow for validation Initializing stdio console driver #v- It happens when I execute "shutdown -r now" command on guest system or "cad" in uml_mconsole. I'm using tt mode and the problem is present in every version I checked - user-mode-linux 2.4.24-1um-2 from Debian, manually compiled 2.4.24 and 2.6.4. This behavior doesn't also depend on host kernel version - I tried 2.4.18, 2.4.24 and 2.6.5. The problem was reported in Debian as a bug #220679 (and forwarded here by Matt Zimmerman) but I think it wasn't solved. On 2.6.5 host kernel it also triggers host kernel BUG in locks_remove_flock from fs/locks.c. fl->flags is FL_POSIX and the kernel expects FL_FLOCK or FL_LEASE. On 2.4.* kernels the bug doesn't show since BUG() line was added in 2.5. I think UML starts its threads with CLONE_FILES and the main process is restarted witch execvp which also preserves the lock. In skas mode the problem is not present because the process that survives the reboot is also the one holding the lock. In tt mode the lock is not placed by the tracing thread so UML cannot place it again. I tried to close all the files (from ubd_dev array) in kill_io_thread function and it helps but I have no idea what happens to the host kernel when UML is not modified. Usually it removes the lock when the main process dies but sometimes the lock is left. Killing all the other processes doesn't also help here. I don't know how to reproduce this without UML. Probably a special combination of clone flags and maybe ptrace settings used by UML is needed. Regards, -- Marcin Pawlik |