* [LVM2 PATCH] Add lv_is_internal() to check internal LVs
@ 2007-08-09 17:55 Jun'ichi Nomura
2007-08-09 18:23 ` Jun'ichi Nomura
0 siblings, 1 reply; 2+ messages in thread
From: Jun'ichi Nomura @ 2007-08-09 17:55 UTC (permalink / raw)
To: lvm-devel
Internal LVs ("snapshotX", mirror logs and mimages) should
not be directly manipulated from commands.
Currently, it's allowed in some places, though.
# lvs -a
LV VG Attr LSize Origin Snap% Move Log Copy%
lvol0 testvg -wi-a- 4.00M
lvol2 testvg mwi-a- 4.00M lvol2_mlog 100.00
[lvol2_mimage_0] testvg iwi-ao 4.00M
[lvol2_mimage_1] testvg iwi-ao 4.00M
[lvol2_mlog] testvg lwi-ao 4.00M
# lvresize -l+1 testvg/lvol2_mimage_1
Extending logical volume lvol2_mimage_1 to 8.00 MB
# lvconvert -s testvg/lvol2_mimage_1 testvg/lvol0
Logical volume lvol0 converted to snapshot.
# lvrename testvg/snapshot0 testvg/s
Renamed "snapshot0" to "s" in volume group "testvg"
# lvconvert -m1 testvg/s
Logical volume s converted.
Until the stacking of LVs are properly supported,
it's safer to disable them.
Attached patch adds lv_is_internal() to check internal LVs.
lv_is_visible() returns true for "snapshotX" so it can't
directly usable for this purpose.
Thanks,
--
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm2-add-lv_is_internal.patch
Type: text/x-patch
Size: 3164 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20070809/eebfd8c3/attachment.bin>
^ permalink raw reply [flat|nested] 2+ messages in thread
* [LVM2 PATCH] Add lv_is_internal() to check internal LVs
2007-08-09 17:55 [LVM2 PATCH] Add lv_is_internal() to check internal LVs Jun'ichi Nomura
@ 2007-08-09 18:23 ` Jun'ichi Nomura
0 siblings, 0 replies; 2+ messages in thread
From: Jun'ichi Nomura @ 2007-08-09 18:23 UTC (permalink / raw)
To: lvm-devel
Jun'ichi Nomura wrote:
> Attached patch adds lv_is_internal() to check internal LVs.
> lv_is_visible() returns true for "snapshotX" so it can't
> directly usable for this purpose.
Oops, sorry. I posted a wrong patch.
> +int lv_is_internal(const struct logical_volume *lv)
> +{
> + if (lv->status & SNAPSHOT)
> + return 0;
> +
> + return lv_is_visible(lv);
> +}
The return value is apparently inverted here.
Internal LVs are either:
- snapshot (i.e. "snapshotX")
- not visible
Resending the correct patch.
Thanks,
--
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm2-add-lv_is_internal.patch
Type: text/x-patch
Size: 3163 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20070809/1c493535/attachment.bin>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-08-09 18:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-09 17:55 [LVM2 PATCH] Add lv_is_internal() to check internal LVs Jun'ichi Nomura
2007-08-09 18:23 ` Jun'ichi Nomura
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.