All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcin Pawlik <wapkil@op.pl>
To: user-mode-linux-devel@lists.sourceforge.net
Subject: [uml-devel] Reboot failing with file locked, CLONE_FILES and host kernel BUG()
Date: Tue, 13 Apr 2004 23:23:07 +0200	[thread overview]
Message-ID: <20040413212307.GA14758@mpmain> (raw)

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


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

             reply	other threads:[~2004-04-13 21:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-13 21:23 Marcin Pawlik [this message]
2004-04-14  1:13 ` [uml-devel] [patch] Re: Reboot failing with file locked, CLONE_FILES and host kernel BUG() Henrik Nordstrom
2004-04-14 13:32   ` Marcin Pawlik
2004-04-14 13:46     ` Marcin Pawlik
2004-04-14 14:44     ` Henrik Nordstrom
2004-04-14 17:09       ` Marcin Pawlik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040413212307.GA14758@mpmain \
    --to=wapkil@op.pl \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.