All of lore.kernel.org
 help / color / mirror / Atom feed
* master - lvm2app: lvm_vg_list_lvs filter hidden LVs
@ 2013-07-23 19:03 tasleson
  2013-07-23 19:27 ` Zdenek Kabelac
  0 siblings, 1 reply; 4+ messages in thread
From: tasleson @ 2013-07-23 19:03 UTC (permalink / raw)
  To: lvm-devel

Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a2b51476007aae91acfc121a7fd2ce04f3b08781
Commit:        a2b51476007aae91acfc121a7fd2ce04f3b08781
Parent:        31de670318c9794690601468def392cd7e4eb0fc
Author:        Tony Asleson <tasleson@redhat.com>
AuthorDate:    Tue Jul 23 14:57:53 2013 -0400
Committer:     Tony Asleson <tasleson@redhat.com>
CommitterDate: Tue Jul 23 14:01:20 2013 -0500

lvm2app: lvm_vg_list_lvs filter hidden LVs

The function lvm_vg_list_lvs was returning all logical
volumes, including *_tmeta and *_tdata.  Added check
to verify that LV is visible before including in list
of returned logical volumes.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
---
 liblvm/lvm_vg.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/liblvm/lvm_vg.c b/liblvm/lvm_vg.c
index 3f4968e..f0da83b 100644
--- a/liblvm/lvm_vg.c
+++ b/liblvm/lvm_vg.c
@@ -250,13 +250,15 @@ struct dm_list *lvm_vg_list_lvs(vg_t vg)
 	dm_list_init(list);
 
 	dm_list_iterate_items(lvl, &vg->lvs) {
-		if (!(lvs = dm_pool_zalloc(vg->vgmem, sizeof(*lvs)))) {
-			log_errno(ENOMEM,
-				"Memory allocation fail for lvm_lv_list.");
-			return NULL;
+		if (lv_is_visible(lvl->lv)) {
+			if (!(lvs = dm_pool_zalloc(vg->vgmem, sizeof(*lvs)))) {
+				log_errno(ENOMEM,
+					"Memory allocation fail for lvm_lv_list.");
+				return NULL;
+			}
+			lvs->lv = lvl->lv;
+			dm_list_add(list, &lvs->list);
 		}
-		lvs->lv = lvl->lv;
-		dm_list_add(list, &lvs->list);
 	}
 	return list;
 }



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* master - lvm2app: lvm_vg_list_lvs filter hidden LVs
  2013-07-23 19:03 master - lvm2app: lvm_vg_list_lvs filter hidden LVs tasleson
@ 2013-07-23 19:27 ` Zdenek Kabelac
  2013-07-23 19:58   ` Tony Asleson
  0 siblings, 1 reply; 4+ messages in thread
From: Zdenek Kabelac @ 2013-07-23 19:27 UTC (permalink / raw)
  To: lvm-devel

Dne 23.7.2013 21:03, tasleson napsal(a):
> Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a2b51476007aae91acfc121a7fd2ce04f3b08781
> Commit:        a2b51476007aae91acfc121a7fd2ce04f3b08781
> Parent:        31de670318c9794690601468def392cd7e4eb0fc
> Author:        Tony Asleson <tasleson@redhat.com>
> AuthorDate:    Tue Jul 23 14:57:53 2013 -0400
> Committer:     Tony Asleson <tasleson@redhat.com>
> CommitterDate: Tue Jul 23 14:01:20 2013 -0500
>
> lvm2app: lvm_vg_list_lvs filter hidden LVs
>
> The function lvm_vg_list_lvs was returning all logical
> volumes, including *_tmeta and *_tdata.  Added check
> to verify that LV is visible before including in list
> of returned logical volumes.

I'm afraid you can't break API this way.
If there is a need for filtered list - you need to filter
list passed from this function - or add something like
lvm_vg_list_visible_lvs.

Zdenek



^ permalink raw reply	[flat|nested] 4+ messages in thread

* master - lvm2app: lvm_vg_list_lvs filter hidden LVs
  2013-07-23 19:27 ` Zdenek Kabelac
@ 2013-07-23 19:58   ` Tony Asleson
  2013-07-23 22:41     ` Zdenek Kabelac
  0 siblings, 1 reply; 4+ messages in thread
From: Tony Asleson @ 2013-07-23 19:58 UTC (permalink / raw)
  To: lvm-devel

On 07/23/2013 02:27 PM, Zdenek Kabelac wrote:
> Dne 23.7.2013 21:03, tasleson napsal(a):
>> Gitweb:       
>> http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a2b51476007aae91acfc121a7fd2ce04f3b08781
>>
>> Commit:        a2b51476007aae91acfc121a7fd2ce04f3b08781
>> Parent:        31de670318c9794690601468def392cd7e4eb0fc
>> Author:        Tony Asleson <tasleson@redhat.com>
>> AuthorDate:    Tue Jul 23 14:57:53 2013 -0400
>> Committer:     Tony Asleson <tasleson@redhat.com>
>> CommitterDate: Tue Jul 23 14:01:20 2013 -0500
>>
>> lvm2app: lvm_vg_list_lvs filter hidden LVs
>>
>> The function lvm_vg_list_lvs was returning all logical
>> volumes, including *_tmeta and *_tdata.  Added check
>> to verify that LV is visible before including in list
>> of returned logical volumes.
> 
> I'm afraid you can't break API this way.
> If there is a need for filtered list - you need to filter
> list passed from this function - or add something like
> lvm_vg_list_visible_lvs.

What kind of modifications are users doing to the hidden meta-data/data
components of a LV thin pool that they would reference each part
individually?

Thanks,
Tony



^ permalink raw reply	[flat|nested] 4+ messages in thread

* master - lvm2app: lvm_vg_list_lvs filter hidden LVs
  2013-07-23 19:58   ` Tony Asleson
@ 2013-07-23 22:41     ` Zdenek Kabelac
  0 siblings, 0 replies; 4+ messages in thread
From: Zdenek Kabelac @ 2013-07-23 22:41 UTC (permalink / raw)
  To: lvm-devel

Dne 23.7.2013 21:58, Tony Asleson napsal(a):
> On 07/23/2013 02:27 PM, Zdenek Kabelac wrote:
>> Dne 23.7.2013 21:03, tasleson napsal(a):
>>> Gitweb:
>>> http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a2b51476007aae91acfc121a7fd2ce04f3b08781
>>>
>>> Commit:        a2b51476007aae91acfc121a7fd2ce04f3b08781
>>> Parent:        31de670318c9794690601468def392cd7e4eb0fc
>>> Author:        Tony Asleson <tasleson@redhat.com>
>>> AuthorDate:    Tue Jul 23 14:57:53 2013 -0400
>>> Committer:     Tony Asleson <tasleson@redhat.com>
>>> CommitterDate: Tue Jul 23 14:01:20 2013 -0500
>>>
>>> lvm2app: lvm_vg_list_lvs filter hidden LVs
>>>
>>> The function lvm_vg_list_lvs was returning all logical
>>> volumes, including *_tmeta and *_tdata.  Added check
>>> to verify that LV is visible before including in list
>>> of returned logical volumes.
>>
>> I'm afraid you can't break API this way.
>> If there is a need for filtered list - you need to filter
>> list passed from this function - or add something like
>> lvm_vg_list_visible_lvs.
>
> What kind of modifications are users doing to the hidden meta-data/data
> components of a LV thin pool that they would reference each part
> individually?


i.e. you could convert  _tmeta into mirror.
And there are other hidden volumes which could be legally removed.

Zdenek





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-07-23 22:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-23 19:03 master - lvm2app: lvm_vg_list_lvs filter hidden LVs tasleson
2013-07-23 19:27 ` Zdenek Kabelac
2013-07-23 19:58   ` Tony Asleson
2013-07-23 22:41     ` Zdenek Kabelac

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.