From: Marcin Pawlik <wapkil@op.pl>
To: Henrik Nordstrom <uml@henrik.marasystems.com>
Cc: user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [uml-devel] [patch] Re: Reboot failing with file locked, CLONE_FILES and host kernel BUG()
Date: Wed, 14 Apr 2004 19:09:43 +0200 [thread overview]
Message-ID: <20040414170943.GA7894@mpmain> (raw)
In-Reply-To: <Pine.LNX.4.44.0404141623190.2915-100000@filer.marasystems.com>
On Wed, Apr 14 at 16:44, Henrik Nordstrom wrote:
> On Wed, 14 Apr 2004, Marcin Pawlik wrote:
>
>> Do you know where and which thread closes the files? I tried to add
>> file closing to kill_io_thread() (patch attached) and it helps but I
>> think it should also be performed without my code.
>
> No, I do not remember, but the thread which originally opened and
> locked the file is apparently not around after the UML has booted.
Yes, but this is not necessarily a problem. Any thread sharing file
description table can close (and therefore unlock) the file.
[...]
>>> int os_lock_file(int fd, int excl)
>>> {
>>> +#if USE_FCNTL_LOCK
>>> int type = excl ? F_WRLCK : F_RDLCK;
>>> struct flock lock = ((struct flock) { .l_type = type,
>>> .l_whence = SEEK_SET,
>>> @@ -710,6 +711,21 @@
>>> err = save;
>>> out:
>>> return(err);
>>> +#else
>>> + int type = excl ? LOCK_EX : LOCK_SH;
>>
>> I don't understand this. IMO excl should be F_RDLCK or F_WRLCK.
>> F_RDLCK is 0, F_WRLCK is 1 and LOCK_EX is 2 so you will always use
>> LOCK_SH.
>
> ???
>
> excl is a boolean, true if the lock should be exclusive (write
Ups. Yes, you are absolutely right. I thought... Well I don't know.
I'm sorry. Probably I should take some sleep :/
[...]
> Seems to works here.. there os no other uses of F_SETLK in my uml
> tree. Using this successfully on RedHat-8 (2.4.20 somthing host
> kernel, no SKAS) and Fedora Core 2 test 1 + SKAS (2.6.something +
> SKAS host kernel)..
I tried it on Debian testing/unstable with different host kernels
(2.4.25, 2.4.25 with skas, 2.6.5, 2.4.18-1-k7 from Debian) and the same
binary on RHEL 3.0 with some 2.4.21. Doesn't work for me. After "cad" or
"halt" in uml_mconsole I have sleeping and traced proceses left.
I placed my testing UML binary and the filesystem (infinite loop in
/sbin/init) on http://www.pwr.wroc.pl/~marcinp/uml/uml.tar.gz (~1.2 MB).
Maybe it depends on UML configuration or compiler used. Could you send
me your --showconfig?
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
prev parent reply other threads:[~2004-04-14 18:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-13 21:23 [uml-devel] Reboot failing with file locked, CLONE_FILES and host kernel BUG() Marcin Pawlik
2004-04-14 1:13 ` [uml-devel] [patch] " 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 [this message]
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=20040414170943.GA7894@mpmain \
--to=wapkil@op.pl \
--cc=uml@henrik.marasystems.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox