1 |
pacho 12/11/24 10:06:55 |
2 |
|
3 |
Added: lvm2-2.02.97-strict-aliasing.patch |
4 |
Log: |
5 |
Commit forgotten patch (by Alexander Tsoy) |
6 |
|
7 |
(Portage version: 2.1.11.31/cvs/Linux x86_64, signed Manifest commit with key A188FBD4) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 sys-fs/lvm2/files/lvm2-2.02.97-strict-aliasing.patch |
11 |
|
12 |
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 |
13 |
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 |
14 |
|
15 |
Index: lvm2-2.02.97-strict-aliasing.patch |
16 |
=================================================================== |
17 |
From 6595cae6e9b65658430714b9731b604c036d0816 Mon Sep 17 00:00:00 2001 |
18 |
From: Zdenek Kabelac <zkabelac@××××××.com> |
19 |
Date: Sat, 13 Oct 2012 18:51:07 +0000 |
20 |
Subject: cleanup: resolve dereferencing type-punned pointer |
21 |
|
22 |
fix gcc warning: |
23 |
dereferencing type-punned pointer will break strict-aliasing rules |
24 |
Replace call by value and pass just const pointer to pvid. |
25 |
--- |
26 |
diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c |
27 |
index 1a52787..a3b45d5 100644 |
28 |
--- a/lib/cache/lvmetad.c |
29 |
+++ b/lib/cache/lvmetad.c |
30 |
@@ -444,7 +444,7 @@ int lvmetad_vg_update(struct volume_group *vg) |
31 |
|
32 |
dm_list_iterate_items(pvl, &vg->pvs) { |
33 |
/* NB. the PV fmt pointer is sometimes wrong during vgconvert */ |
34 |
- if (pvl->pv->dev && !lvmetad_pv_found(pvl->pv->id, pvl->pv->dev, |
35 |
+ if (pvl->pv->dev && !lvmetad_pv_found(&pvl->pv->id, pvl->pv->dev, |
36 |
vg->fid ? vg->fid->fmt : pvl->pv->fmt, |
37 |
pvl->pv->label_sector, NULL, NULL)) |
38 |
return 0; |
39 |
@@ -657,7 +657,7 @@ static int _extract_mdas(struct lvmcache_info *info, struct dm_config_tree *cft, |
40 |
return 1; |
41 |
} |
42 |
|
43 |
-int lvmetad_pv_found(struct id pvid, struct device *device, const struct format_type *fmt, |
44 |
+int lvmetad_pv_found(const struct id *pvid, struct device *device, const struct format_type *fmt, |
45 |
uint64_t label_sector, struct volume_group *vg, activation_handler handler) |
46 |
{ |
47 |
char uuid[64]; |
48 |
@@ -670,7 +670,7 @@ int lvmetad_pv_found(struct id pvid, struct device *device, const struct format_ |
49 |
if (!lvmetad_active() || test_mode()) |
50 |
return 1; |
51 |
|
52 |
- if (!id_write_format(&pvid, uuid, sizeof(uuid))) |
53 |
+ if (!id_write_format(pvid, uuid, sizeof(uuid))) |
54 |
return_0; |
55 |
|
56 |
pvmeta = dm_config_create(); |
57 |
@@ -848,7 +848,7 @@ int lvmetad_pvscan_single(struct cmd_context *cmd, struct device *dev, |
58 |
* *exact* image of the system, the lvmetad instance that went out of |
59 |
* sync needs to be killed. |
60 |
*/ |
61 |
- if (!lvmetad_pv_found(*(struct id *)dev->pvid, dev, lvmcache_fmt(info), |
62 |
+ if (!lvmetad_pv_found((const struct id *) &dev->pvid, dev, lvmcache_fmt(info), |
63 |
label->sector, baton.vg, handler)) { |
64 |
release_vg(baton.vg); |
65 |
goto_bad; |
66 |
diff --git a/lib/cache/lvmetad.h b/lib/cache/lvmetad.h |
67 |
index 724922d..5f0f552 100644 |
68 |
--- a/lib/cache/lvmetad.h |
69 |
+++ b/lib/cache/lvmetad.h |
70 |
@@ -93,7 +93,7 @@ int lvmetad_vg_remove(struct volume_group *vg); |
71 |
* number on the cached and on the discovered PV match but the metadata content |
72 |
* does not. |
73 |
*/ |
74 |
-int lvmetad_pv_found(struct id pvid, struct device *device, |
75 |
+int lvmetad_pv_found(const struct id *pvid, struct device *device, |
76 |
const struct format_type *fmt, uint64_t label_sector, |
77 |
struct volume_group *vg, activation_handler handler); |
78 |
|
79 |
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c |
80 |
index 5a633b6..c210a63 100644 |
81 |
--- a/lib/metadata/metadata.c |
82 |
+++ b/lib/metadata/metadata.c |
83 |
@@ -3807,7 +3807,7 @@ int pv_write(struct cmd_context *cmd __attribute__((unused)), |
84 |
if (!pv->fmt->ops->pv_write(pv->fmt, pv)) |
85 |
return_0; |
86 |
|
87 |
- if (!lvmetad_pv_found(pv->id, pv->dev, pv->fmt, pv->label_sector, |
88 |
+ if (!lvmetad_pv_found(&pv->id, pv->dev, pv->fmt, pv->label_sector, |
89 |
NULL, NULL)) |
90 |
return_0; |
91 |
|
92 |
-- |
93 |
cgit v0.9.0.3 |