[PATCH] Make preserve work for RAID in FAI 3.4.x

Julien BLACHE jblache at debian.org
Fri Sep 17 19:00:53 CEST 2010


Michael Tautschnig <mt at debian.org> wrote:

Hi,

> absolutely fine if the fix goes in via this patch). Just one stylistic note:
> Unless I'm missing something, the following if ... elsif ...
>
>> -        if (&FAI::set_partition_type_on_phys_dev($d, "raid")) {
>> +	if ($vol->{preserve}) {
>> +          $pre_req .= ",pt_complete_" . (&FAI::phys_dev($d))[1];
>> +        } elsif (&FAI::set_partition_type_on_phys_dev($d, "raid")) {
>>            $pre_req .= ",pt_complete_" . (&FAI::phys_dev($d))[1];
>>          } else {
>>            $pre_req .= ",exist_$d";
>>          }
>>        }
>
> ... could be rewritten as
>
>   if ($vol->{preserve} || &FAI::set_partition_type_on_phys_dev($d, "raid"))

That was actually written this way on purpose, for several reasons:
 - I don't know how Perl evaluates the if condition (this is usually
   unspecified in most languages), and set_partition_... should not be
   executed at all for preserved partitions, it just helps making this
   clear
 - it makes it clear that preserved partitions need the
   pt_complete_... prereq for reasons that are different from the
   non-preserved case.

Though pt_complete is only for physical devices, so all things
considered I should have a second look at this. I'll do this on monday.

JB.

-- 
 Julien BLACHE <jblache at debian.org>  |  Debian, because code matters more 
 Debian & GNU/Linux Developer        |       <http://www.debian.org>
 Public key available on <http://www.jblache.org> - KeyID: F5D6 5169 
 GPG Fingerprint : 935A 79F1 C8B3 3521 FD62 7CC7 CD61 4FD7 F5D6 5169 


More information about the linux-fai-devel mailing list