* [PATCH] Ignore _mlog name restriction for lvconvert repair
@ 2010-02-10 17:12 Malahal Naineni
2010-02-11 19:55 ` Takahiro Yasui
0 siblings, 1 reply; 7+ messages in thread
From: Malahal Naineni @ 2010-02-10 17:12 UTC (permalink / raw)
To: lvm-devel
lvconvert --repair is done on _mlog mirrored log logical volumes from
dmeventd if something fails.
diff -r 86200db56a7c -r 471e224a5713 tools/lvconvert.c
--- a/tools/lvconvert.c Tue Feb 09 17:49:50 2010 -0800
+++ b/tools/lvconvert.c Wed Feb 10 09:12:11 2010 -0800
@@ -105,8 +105,12 @@ static int _lvconvert_name_params(struct
if ((ptr = strrchr(lp->lv_name_full, '/')))
lp->lv_name = ptr + 1;
- if (!apply_lvname_restrictions(lp->lv_name))
- return_0;
+ /* _mlog is an internal name, but it could be mirrored, so
+ * allow repairing it.
+ */
+ if (!arg_count(cmd, repair_ARG) || !strstr(lp->lv_name, "_mlog"))
+ if (!apply_lvname_restrictions(lp->lv_name))
+ return_0;
if (*pargc && lp->snapshot) {
log_error("Too many arguments provided for snapshots");
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] Ignore _mlog name restriction for lvconvert repair
2010-02-10 17:12 [PATCH] Ignore _mlog name restriction for lvconvert repair Malahal Naineni
@ 2010-02-11 19:55 ` Takahiro Yasui
2010-02-11 20:38 ` malahal
0 siblings, 1 reply; 7+ messages in thread
From: Takahiro Yasui @ 2010-02-11 19:55 UTC (permalink / raw)
To: lvm-devel
Malahal Naineni wrote:
> lvconvert --repair is done on _mlog mirrored log logical volumes from
> dmeventd if something fails.
>
> diff -r 86200db56a7c -r 471e224a5713 tools/lvconvert.c
> --- a/tools/lvconvert.c Tue Feb 09 17:49:50 2010 -0800
> +++ b/tools/lvconvert.c Wed Feb 10 09:12:11 2010 -0800
> @@ -105,8 +105,12 @@ static int _lvconvert_name_params(struct
> if ((ptr = strrchr(lp->lv_name_full, '/')))
> lp->lv_name = ptr + 1;
>
> - if (!apply_lvname_restrictions(lp->lv_name))
> - return_0;
> + /* _mlog is an internal name, but it could be mirrored, so
> + * allow repairing it.
> + */
> + if (!arg_count(cmd, repair_ARG) || !strstr(lp->lv_name, "_mlog"))
> + if (!apply_lvname_restrictions(lp->lv_name))
> + return_0;
>
> if (*pargc && lp->snapshot) {
> log_error("Too many arguments provided for snapshots");
lvname is better to be checked if a logical volume is not mirrored log
but simple logical volume. How about using (lv->status & MIRRORED) for
the check?
Thanks,
Taka
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] Ignore _mlog name restriction for lvconvert repair
2010-02-11 19:55 ` Takahiro Yasui
@ 2010-02-11 20:38 ` malahal
2010-02-12 1:14 ` Takahiro Yasui
0 siblings, 1 reply; 7+ messages in thread
From: malahal @ 2010-02-11 20:38 UTC (permalink / raw)
To: lvm-devel
Takahiro Yasui [tyasui at redhat.com] wrote:
> Malahal Naineni wrote:
> > lvconvert --repair is done on _mlog mirrored log logical volumes from
> > dmeventd if something fails.
> >
> > diff -r 86200db56a7c -r 471e224a5713 tools/lvconvert.c
> > --- a/tools/lvconvert.c Tue Feb 09 17:49:50 2010 -0800
> > +++ b/tools/lvconvert.c Wed Feb 10 09:12:11 2010 -0800
> > @@ -105,8 +105,12 @@ static int _lvconvert_name_params(struct
> > if ((ptr = strrchr(lp->lv_name_full, '/')))
> > lp->lv_name = ptr + 1;
> >
> > - if (!apply_lvname_restrictions(lp->lv_name))
> > - return_0;
> > + /* _mlog is an internal name, but it could be mirrored, so
> > + * allow repairing it.
> > + */
> > + if (!arg_count(cmd, repair_ARG) || !strstr(lp->lv_name, "_mlog"))
> > + if (!apply_lvname_restrictions(lp->lv_name))
> > + return_0;
> >
> > if (*pargc && lp->snapshot) {
> > log_error("Too many arguments provided for snapshots");
>
> lvname is better to be checked if a logical volume is not mirrored log
> but simple logical volume. How about using (lv->status & MIRRORED) for
> the check?
I thought about it but such details are not available at that point. All
the information available at that point is derived from the command line
arguments!
Thanks, Malahal.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] Ignore _mlog name restriction for lvconvert repair
2010-02-11 20:38 ` malahal
@ 2010-02-12 1:14 ` Takahiro Yasui
2010-02-12 21:30 ` Jonathan Brassow
0 siblings, 1 reply; 7+ messages in thread
From: Takahiro Yasui @ 2010-02-12 1:14 UTC (permalink / raw)
To: lvm-devel
malahal at us.ibm.com wrote:
> Takahiro Yasui [tyasui at redhat.com] wrote:
>> Malahal Naineni wrote:
>>> lvconvert --repair is done on _mlog mirrored log logical volumes from
>>> dmeventd if something fails.
>>>
>>> diff -r 86200db56a7c -r 471e224a5713 tools/lvconvert.c
>>> --- a/tools/lvconvert.c Tue Feb 09 17:49:50 2010 -0800
>>> +++ b/tools/lvconvert.c Wed Feb 10 09:12:11 2010 -0800
>>> @@ -105,8 +105,12 @@ static int _lvconvert_name_params(struct
>>> if ((ptr = strrchr(lp->lv_name_full, '/')))
>>> lp->lv_name = ptr + 1;
>>>
>>> - if (!apply_lvname_restrictions(lp->lv_name))
>>> - return_0;
>>> + /* _mlog is an internal name, but it could be mirrored, so
>>> + * allow repairing it.
>>> + */
>>> + if (!arg_count(cmd, repair_ARG) || !strstr(lp->lv_name, "_mlog"))
>>> + if (!apply_lvname_restrictions(lp->lv_name))
>>> + return_0;
>>>
>>> if (*pargc && lp->snapshot) {
>>> log_error("Too many arguments provided for snapshots");
>> lvname is better to be checked if a logical volume is not mirrored log
>> but simple logical volume. How about using (lv->status & MIRRORED) for
>> the check?
>
> I thought about it but such details are not available at that point. All
> the information available at that point is derived from the command line
> arguments!
Thank you for the explanation. I see we need to move this name check
at the place where lv->status check can be used.
Thanks,
Taka
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] Ignore _mlog name restriction for lvconvert repair
2010-02-12 1:14 ` Takahiro Yasui
@ 2010-02-12 21:30 ` Jonathan Brassow
2010-02-12 21:45 ` Jonathan Brassow
2010-02-12 22:14 ` Takahiro Yasui
0 siblings, 2 replies; 7+ messages in thread
From: Jonathan Brassow @ 2010-02-12 21:30 UTC (permalink / raw)
To: lvm-devel
On Feb 11, 2010, at 7:14 PM, Takahiro Yasui wrote:
> malahal at us.ibm.com wrote:
>> Takahiro Yasui [tyasui at redhat.com] wrote:
>>> Malahal Naineni wrote:
>>>> lvconvert --repair is done on _mlog mirrored log logical volumes
>>>> from
>>>> dmeventd if something fails.
>>>>
>>>> diff -r 86200db56a7c -r 471e224a5713 tools/lvconvert.c
>>>> --- a/tools/lvconvert.c Tue Feb 09 17:49:50 2010 -0800
>>>> +++ b/tools/lvconvert.c Wed Feb 10 09:12:11 2010 -0800
>>>> @@ -105,8 +105,12 @@ static int _lvconvert_name_params(struct
>>>> if ((ptr = strrchr(lp->lv_name_full, '/')))
>>>> lp->lv_name = ptr + 1;
>>>>
>>>> - if (!apply_lvname_restrictions(lp->lv_name))
>>>> - return_0;
>>>> + /* _mlog is an internal name, but it could be mirrored, so
>>>> + * allow repairing it.
>>>> + */
>>>> + if (!arg_count(cmd, repair_ARG) || !strstr(lp->lv_name, "_mlog"))
>>>> + if (!apply_lvname_restrictions(lp->lv_name))
>>>> + return_0;
>>>>
>>>> if (*pargc && lp->snapshot) {
>>>> log_error("Too many arguments provided for snapshots");
>>> lvname is better to be checked if a logical volume is not mirrored
>>> log
>>> but simple logical volume. How about using (lv->status & MIRRORED)
>>> for
>>> the check?
>>
>> I thought about it but such details are not available at that
>> point. All
>> the information available at that point is derived from the command
>> line
>> arguments!
>
> Thank you for the explanation. I see we need to move this name check
> at the place where lv->status check can be used.
It might make sense to do it in this very spot... If the repair_ARG
is present, why should we be checking lvname restrictions anyway? No
new LVs are being created.
Something more like:
if (!arg_count(cmd, repair_ARG) && !apply_lvname_restrictions(lp-
>lv_name))
Anyone see anything wrong with that?
Taka, I've not been able to reproduce your seg faults with '--alloc
anywhere' using two devices. Is there a special restriction you are
using?
brassow
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] Ignore _mlog name restriction for lvconvert repair
2010-02-12 21:30 ` Jonathan Brassow
@ 2010-02-12 21:45 ` Jonathan Brassow
2010-02-12 22:14 ` Takahiro Yasui
1 sibling, 0 replies; 7+ messages in thread
From: Jonathan Brassow @ 2010-02-12 21:45 UTC (permalink / raw)
To: lvm-devel
On Feb 12, 2010, at 3:30 PM, Jonathan Brassow wrote:
>
> On Feb 11, 2010, at 7:14 PM, Takahiro Yasui wrote:
>
>> malahal at us.ibm.com wrote:
>>> Takahiro Yasui [tyasui at redhat.com] wrote:
>>>> Malahal Naineni wrote:
>>>>> lvconvert --repair is done on _mlog mirrored log logical volumes
>>>>> from
>>>>> dmeventd if something fails.
>>>>>
>>>>> diff -r 86200db56a7c -r 471e224a5713 tools/lvconvert.c
>>>>> --- a/tools/lvconvert.c Tue Feb 09 17:49:50 2010 -0800
>>>>> +++ b/tools/lvconvert.c Wed Feb 10 09:12:11 2010 -0800
>>>>> @@ -105,8 +105,12 @@ static int _lvconvert_name_params(struct
>>>>> if ((ptr = strrchr(lp->lv_name_full, '/')))
>>>>> lp->lv_name = ptr + 1;
>>>>>
>>>>> - if (!apply_lvname_restrictions(lp->lv_name))
>>>>> - return_0;
>>>>> + /* _mlog is an internal name, but it could be mirrored, so
>>>>> + * allow repairing it.
>>>>> + */
>>>>> + if (!arg_count(cmd, repair_ARG) || !strstr(lp->lv_name,
>>>>> "_mlog"))
>>>>> + if (!apply_lvname_restrictions(lp->lv_name))
>>>>> + return_0;
>>>>>
>>>>> if (*pargc && lp->snapshot) {
>>>>> log_error("Too many arguments provided for snapshots");
>>>> lvname is better to be checked if a logical volume is not
>>>> mirrored log
>>>> but simple logical volume. How about using (lv->status &
>>>> MIRRORED) for
>>>> the check?
>>>
>>> I thought about it but such details are not available at that
>>> point. All
>>> the information available at that point is derived from the
>>> command line
>>> arguments!
>>
>> Thank you for the explanation. I see we need to move this name check
>> at the place where lv->status check can be used.
>
> It might make sense to do it in this very spot... If the repair_ARG
> is present, why should we be checking lvname restrictions anyway?
> No new LVs are being created.
>
> Something more like:
> if (!arg_count(cmd, repair_ARG) && !apply_lvname_restrictions(lp-
> >lv_name))
>
> Anyone see anything wrong with that?
>
> Taka, I've not been able to reproduce your seg faults with '--alloc
> anywhere' using two devices. Is there a special restriction you are
> using?
agk wants to see if we can /not/ use <lv>_mlog as the argument passed
in. So, dmeventd would probably strip the '_mlog' portion.(?) There
are definitely some items to clean up in this case. I'm going to give
it a shot. If it turns out to be really bad, we might go with the
above suggestion.
brassow
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] Ignore _mlog name restriction for lvconvert repair
2010-02-12 21:30 ` Jonathan Brassow
2010-02-12 21:45 ` Jonathan Brassow
@ 2010-02-12 22:14 ` Takahiro Yasui
1 sibling, 0 replies; 7+ messages in thread
From: Takahiro Yasui @ 2010-02-12 22:14 UTC (permalink / raw)
To: lvm-devel
Hello Jon,
> Taka, I've not been able to reproduce your seg faults with '--alloc
> anywhere' using two devices. Is there a special restriction you are
> using?
Here is the reproduction steps.
[case 1]
1. create VG with two devices.
# vgcreate vg00 /dev/sd[ab]
2. create LV with mirrored log
# lvcreate -m1 -L12m -nlv00 --mirrorlog mirrored --alloc anywhere vg00
3. disable device /dev/sdb
# echo offline > /sys/block/sdb/device/state
4. Write data
# dd if=/dev/zero of=/dev/vg00/lv00 bs=4096 count=1
1+0 records in
1+0 records out
4096 bytes (4.1 kB) copied, 3.02835 seconds, 1.4 kB/s
5. convert LV to mirrored log
# lvconvert -m1 --mirrorlog mirrored --alloc anywhere vg00/lv00
/dev/sdd: open failed: No such device or address
Segmentation fault
[case 2]
# vgs
No volume groups found
# vgcreate vg00 /dev/sdc
Volume group "vg00" successfully created
# lvcreate -m1 -L12m -nlv00 --mirrorlog mirrored --alloc anywhere vg00
Segmentation fault
I hope you could reproduce this issues.
Thanks,
Taka
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-02-12 22:14 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-10 17:12 [PATCH] Ignore _mlog name restriction for lvconvert repair Malahal Naineni
2010-02-11 19:55 ` Takahiro Yasui
2010-02-11 20:38 ` malahal
2010-02-12 1:14 ` Takahiro Yasui
2010-02-12 21:30 ` Jonathan Brassow
2010-02-12 21:45 ` Jonathan Brassow
2010-02-12 22:14 ` Takahiro Yasui
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.