Satoshi Uchida
2005-Nov-30 03:04 UTC
[Xen-devel] [patch] loopback block device confliction is fixed.
Hi. I found cause of problem that loopback devices is not connect when more than two loopback block devices is used. The cause is setup these loopback block devices concurrently, so that these devices indicate same loopback devices. (show log file ... message.log) I attach tentative patch for this problem. (block.patch) This patch is that searching is stopped if free loop back device is found. Process is very fast, so that in my environments, confliction is not observed. I think that good resolution is provide lock mechanism. Thank you. diff -r 243265ade404 tools/examples/block --- a/tools/examples/block Mon Nov 28 17:22:02 2005 +++ b/tools/examples/block Wed Nov 30 12:35:35 2005 @@ -238,6 +238,7 @@ if [ "$loopdev" == '''' ] then loopdev="$dev" + break fi fi done _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Satoshi Uchida
2005-Nov-30 06:20 UTC
Re: [Xen-devel] [patch] loopback block device confliction is fixed.
Hi. Sorry. My past patch cannot solve confliction problems, but can decrease its occurrence. And, when loopback devices mounted become fragment, sharing cannot checked for all loopback devices. Therefore, I create new patch. This patch is to stock candidate devices at first stage ( searching and sharing check stage), and to try to assign loopback devices within candidate devise gradually. Thanks Satoshi UCHIDA diff -r 243265ade404 tools/examples/block --- a/tools/examples/block Mon Nov 28 17:22:02 2005 +++ b/tools/examples/block Wed Nov 30 15:08:26 2005 @@ -202,7 +202,7 @@ mount it read-write in a guest domain." fi - loopdev='''' + loopdevs='''' for dev in /dev/loop* do @@ -235,26 +235,26 @@ # $dev is not in use, so we''ll remember it for use later; we want # to finish the sharing check first. - if [ "$loopdev" == '''' ] - then - loopdev="$dev" - fi + loopdevs="$loopdevs $dev" fi done - if [ "$loopdev" == '''' ] + if [ "$loopdevs" == '''' ] then fatal ''Failed to find an unused loop device'' fi - if losetup "$loopdev" "$file" - then - xenstore_write "$XENBUS_PATH/node" "$loopdev" - write_dev "$loopdev" - exit 0 - else - fatal "losetup $loopdev $file failed" - fi + for loopdev in $loopdevs + do + if losetup "$loopdev" "$file" + then + xenstore_write "$XENBUS_PATH/node" "$loopdev" + write_dev "$loopdev" + exit 0 + fi + done + + fatal "losetup $loopdev $file failed" ;; esac ;; _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ewan Mellor
2005-Dec-02 15:56 UTC
Re: [Xen-devel] [patch] loopback block device confliction is fixed.
On Wed, Nov 30, 2005 at 12:04:36PM +0900, Satoshi Uchida wrote:> Hi. > > I found cause of problem that loopback devices is not connect when more > than two loopback block devices is used. > The cause is setup these loopback block devices concurrently, so that > these devices indicate same loopback devices. > (show log file ... message.log) > > I attach tentative patch for this problem. (block.patch) > This patch is that searching is stopped if free loop back device is > found. > Process is very fast, so that in my environments, confliction is not > observed. > > I think that good resolution is provide lock mechanism.Thanks for your analysis and your tentative patch. You were right that a better fix was to provide a lock mechanism, and that''s what I''ve done. Cheers, Ewan. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel