All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH 05/11] Add pv_initialise to format_handler interface.
Date: Thu, 25 Nov 2010 14:28:18 +0100	[thread overview]
Message-ID: <4CEE6472.5020803@redhat.com> (raw)
In-Reply-To: <1290115945-27419-6-git-send-email-prajnoha@redhat.com>

Dne 18.11.2010 22:32, Peter Rajnoha napsal(a):

> diff --git a/lib/format1/disk-rep.c b/lib/format1/disk-rep.c
> index bc58744..38cb34d 100644
> --- a/lib/format1/disk-rep.c
> +++ b/lib/format1/disk-rep.c
> @@ -337,6 +337,13 @@ static void __update_lvmcache(const struct format_type *fmt,
>  

Interesting - we should not use  '__' as prefix in our code - though not
directly related to our code.



>  	info->device_size = xlate32(dl->pvd.pv_size) << SECTOR_SHIFT;
>  	dm_list_init(&info->mdas);
> +	if (info->mda_slots)
> +		dm_free(info->mda_slots);
> +	if (!(info->mda_slots = dm_zalloc(FMT_LVM1_MAX_MDAS_PER_PV * sizeof(struct metadata_area *)))) {
> +		/* FIXME: Add revert of cache info! */
> +		stack;
> +		return;

This is yet another reason why we should not play with cache internally - we
may introduce internal consistency problem and may get into the moment when
our cache will represent different data than does we would read from disk.


> +
> +	if (!(info->mda_slots = dm_zalloc(FMT_TEXT_MAX_MDAS_PER_PV * sizeof(struct metadata_area *)))) {
> +		/* FIXME: Add revert of cache info! */

again quite important case...

> +		return 0;
> +	}
> +
> +	return 1;
> +}
> +
>  static void _text_destroy_instance(struct format_instance *fid __attribute__((unused)))
>  {
>  }


Zdenek



  reply	other threads:[~2010-11-25 13:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-18 21:32 [PATCH 00/11] Add interface to support adding and removing metadata areas on demand Peter Rajnoha
2010-11-18 21:32 ` [PATCH 01/11] Add mda_slots field for PV info in the cache Peter Rajnoha
2010-11-25 13:15   ` Zdenek Kabelac
2010-11-25 13:39     ` Peter Rajnoha
2010-11-25 13:45       ` Peter Rajnoha
2010-11-18 21:32 ` [PATCH 02/11] Add pe_start_locked flag in struct physical_volume to retain pe_start Peter Rajnoha
2010-11-18 21:32 ` [PATCH 03/11] Add pv_add_metadata_area to format_handler interface Peter Rajnoha
2010-11-18 21:32 ` [PATCH 04/11] Add pv_remove_metadata_area " Peter Rajnoha
2010-11-25 13:21   ` Zdenek Kabelac
2010-11-18 21:32 ` [PATCH 05/11] Add pv_initialise " Peter Rajnoha
2010-11-25 13:28   ` Zdenek Kabelac [this message]
2010-11-18 21:32 ` [PATCH 06/11] Refactor pv_setup to not include the initialisation only code Peter Rajnoha
2010-11-18 21:32 ` [PATCH 07/11] Remove unused _mda_setup Peter Rajnoha
2010-11-18 21:32 ` [PATCH 08/11] Cleanup pv_write to use recent changes in metadata handling interface Peter Rajnoha
2010-11-18 21:32 ` [PATCH 09/11] Remove useless mdas parameter in code creating new PVs Peter Rajnoha
2010-11-18 21:32 ` [PATCH 10/11] Make existing lvmcache_update_pvid public Peter Rajnoha
2010-11-18 21:32 ` [PATCH 11/11] Use new metadata interface to provide better support for PV resize Peter Rajnoha

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=4CEE6472.5020803@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.