All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH] LVM RAID: a couple more fixes
Date: Fri, 12 Aug 2011 22:34:52 +0200	[thread overview]
Message-ID: <4E458E6C.7090309@redhat.com> (raw)
In-Reply-To: <1313169003.27367.6.camel@f14.redhat.com>

Dne 12.8.2011 19:10, Jonathan Brassow napsal(a):
> Patch includes:
> 1) add new function 'raid_remove_top_layer' which will be useful
>  to other conversion functions later (also cleans up code)
> 2) Add error messages if raid_[extract|add]_images fails
> 3) DO NOT activate sub_lv's between a suspend/resume
> 4) Add function prototypes to prevent compiler warnings when
>  compiling with '--with-raid=shared'
> 
> Also, can someone provide insight on removing the 'sleep(1)'?  Without
> it, I get "device in use: cannot deactivate" error messages - even
> though it is /not/ in-use.
> 
>  brassow
> 
> 
> @@ -465,9 +499,17 @@ int lv_raid_change_image_count(struct lo
>  
>  	/*
>  	 * Eliminate the extracted LVs
> +	 * The extracted devices do not take on their new names
> +	 * (i.e. *_extracted) unless we suspend/resume them.  It
> +	 * is not strictly necessary, so we skip that step.
>  	 */
>  	if (!dm_list_empty(&removal_list)) {
>  		dm_list_iterate_items(lvl, &removal_list) {
> +			/*
> +			 * FIXME: Remove 'sleep' that is necessary to prevent
> +			 * "device in use" errors - udev not fast enough?
> +			 */
> +			sleep(1);
>  			if (!deactivate_lv(lv->vg->cmd, lvl->lv))
>  				return_0;
>  			if (!lv_remove(lvl->lv))

I've not checked the rest of this patch - just noticed this very strange sleep
in the code.

You need to take a look at how vgchange is working.

Essentially you need to split this loop in 2 parts - first deactivate all you
can within one  'udev transaction' - then you need to 'synchronize with udev
(sync_local_dev_names() - i.e. see set_lv() in lv_manip.c)
Once udev is finished you may start to lv_remove() devices - this would give
optimal performance.  If you would do that in one loop - there is huge udev
latency penalty - thought you may just try it for test it's really working ;)

Zdenek



  reply	other threads:[~2011-08-12 20:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-12 17:10 [PATCH] LVM RAID: a couple more fixes Jonathan Brassow
2011-08-12 20:34 ` Zdenek Kabelac [this message]
2011-08-13  4:33 ` Jonathan Brassow

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=4E458E6C.7090309@redhat.com \
    --to=zkabelac@redhat.com \
    --cc=lvm-devel@redhat.com \
    /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.