public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in sys-fs/lvm2/files: lvm2-2.02.97-strict-aliasing.patch
@ 2012-11-24 10:06 Pacho Ramos (pacho)
  0 siblings, 0 replies; only message in thread
From: Pacho Ramos (pacho) @ 2012-11-24 10:06 UTC (permalink / raw
  To: gentoo-commits

pacho       12/11/24 10:06:55

  Added:                lvm2-2.02.97-strict-aliasing.patch
  Log:
  Commit forgotten patch (by Alexander Tsoy)
  
  (Portage version: 2.1.11.31/cvs/Linux x86_64, signed Manifest commit with key A188FBD4)

Revision  Changes    Path
1.1                  sys-fs/lvm2/files/lvm2-2.02.97-strict-aliasing.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/lvm2/files/lvm2-2.02.97-strict-aliasing.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/lvm2/files/lvm2-2.02.97-strict-aliasing.patch?rev=1.1&content-type=text/plain

Index: lvm2-2.02.97-strict-aliasing.patch
===================================================================
From 6595cae6e9b65658430714b9731b604c036d0816 Mon Sep 17 00:00:00 2001
From: Zdenek Kabelac <zkabelac@redhat.com>
Date: Sat, 13 Oct 2012 18:51:07 +0000
Subject: cleanup: resolve dereferencing type-punned pointer

fix gcc warning:
dereferencing type-punned pointer will break strict-aliasing rules
Replace call by value and pass just const pointer to pvid.
---
diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c
index 1a52787..a3b45d5 100644
--- a/lib/cache/lvmetad.c
+++ b/lib/cache/lvmetad.c
@@ -444,7 +444,7 @@ int lvmetad_vg_update(struct volume_group *vg)
 
 	dm_list_iterate_items(pvl, &vg->pvs) {
 		/* NB. the PV fmt pointer is sometimes wrong during vgconvert */
-		if (pvl->pv->dev && !lvmetad_pv_found(pvl->pv->id, pvl->pv->dev,
+		if (pvl->pv->dev && !lvmetad_pv_found(&pvl->pv->id, pvl->pv->dev,
 						      vg->fid ? vg->fid->fmt : pvl->pv->fmt,
 						      pvl->pv->label_sector, NULL, NULL))
 			return 0;
@@ -657,7 +657,7 @@ static int _extract_mdas(struct lvmcache_info *info, struct dm_config_tree *cft,
 	return 1;
 }
 
-int lvmetad_pv_found(struct id pvid, struct device *device, const struct format_type *fmt,
+int lvmetad_pv_found(const struct id *pvid, struct device *device, const struct format_type *fmt,
 		     uint64_t label_sector, struct volume_group *vg, activation_handler handler)
 {
 	char uuid[64];
@@ -670,7 +670,7 @@ int lvmetad_pv_found(struct id pvid, struct device *device, const struct format_
 	if (!lvmetad_active() || test_mode())
 		return 1;
 
-	if (!id_write_format(&pvid, uuid, sizeof(uuid)))
+	if (!id_write_format(pvid, uuid, sizeof(uuid)))
                 return_0;
 
 	pvmeta = dm_config_create();
@@ -848,7 +848,7 @@ int lvmetad_pvscan_single(struct cmd_context *cmd, struct device *dev,
 	 * *exact* image of the system, the lvmetad instance that went out of
 	 * sync needs to be killed.
 	 */
-	if (!lvmetad_pv_found(*(struct id *)dev->pvid, dev, lvmcache_fmt(info),
+	if (!lvmetad_pv_found((const struct id *) &dev->pvid, dev, lvmcache_fmt(info),
 			      label->sector, baton.vg, handler)) {
 		release_vg(baton.vg);
 		goto_bad;
diff --git a/lib/cache/lvmetad.h b/lib/cache/lvmetad.h
index 724922d..5f0f552 100644
--- a/lib/cache/lvmetad.h
+++ b/lib/cache/lvmetad.h
@@ -93,7 +93,7 @@ int lvmetad_vg_remove(struct volume_group *vg);
  * number on the cached and on the discovered PV match but the metadata content
  * does not.
  */
-int lvmetad_pv_found(struct id pvid, struct device *device,
+int lvmetad_pv_found(const struct id *pvid, struct device *device,
 		     const struct format_type *fmt, uint64_t label_sector,
 		     struct volume_group *vg, activation_handler handler);
 
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index 5a633b6..c210a63 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -3807,7 +3807,7 @@ int pv_write(struct cmd_context *cmd __attribute__((unused)),
 	if (!pv->fmt->ops->pv_write(pv->fmt, pv))
 		return_0;
 
-	if (!lvmetad_pv_found(pv->id, pv->dev, pv->fmt, pv->label_sector,
+	if (!lvmetad_pv_found(&pv->id, pv->dev, pv->fmt, pv->label_sector,
 			      NULL, NULL))
 		return_0;
 
--
cgit v0.9.0.3





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-11-24 10:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-24 10:06 [gentoo-commits] gentoo-x86 commit in sys-fs/lvm2/files: lvm2-2.02.97-strict-aliasing.patch Pacho Ramos (pacho)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox