Skip to content

Commit

Permalink
fix problem reuse of large number of partittions and few extra partit…
Browse files Browse the repository at this point in the history
…ion slots available (e.g. 15 on cciss) (bnc#799725)
  • Loading branch information
Thomas Fehr committed Jan 24, 2013
1 parent d4eef55 commit be29165
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
6 changes: 6 additions & 0 deletions package/autoyast2.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Jan 24 11:43:57 CET 2013 - fehr@suse.de

- fix problem reuse of large number of partittions and few extra
partition slots available (e.g. 15 on cciss) (bnc#799725)

-------------------------------------------------------------------
Tue Nov 13 18:00:23 CET 2012 - fehr@suse.de

Expand Down
25 changes: 10 additions & 15 deletions src/include/autopart.ycp
Expand Up @@ -851,17 +851,13 @@ global map AddFilesysData( map st_map, map xml_map )
* available primaries and logical slots )
*/

/*
// FIXME: bnc#620212 - this test is buggy. Reusing more partitions than the hardware still could create will fail
// should be size(ps)-NUM_OF_REUSED
if( size(g["gap"]:[])>0 &&
((g["extended_possible"]:false &&
// size(g["free_pnr"]:[])>0 && // reusing all 4 primaries will fail with this
size(ps)+1 <= size(g["ext_pnr"]:[])+size(g["free_pnr"]:[])) ||
(!g["extended_possible"]:false &&
size(ps) <= size(g["ext_pnr"]:[])+size(g["free_pnr"]:[]))) )
*/
if( size(g["gap"]:[])>0 )
list new_ps = filter( map p, (list<map>)ps, ``(p["create"]:true));
integer free_pnr = size(g["free_pnr"]:[]);
if( g["extended_possible"]:false )
free_pnr = free_pnr - 1 + size(g["ext_pnr"]:[]);
y2milestone( "get_perfect_list: size(ps):%1 size(new_ps):%2 sum_free:%3",
size(ps), size(new_ps), free_pnr );
if( size(g["gap"]:[])>0 && size(new_ps) <= free_pnr )
{
map lg = (map) eval(g);

Expand Down Expand Up @@ -961,10 +957,7 @@ global map AddFilesysData( map st_map, map xml_map )

if( reuseCondition &&
part["max_cyl"]:0 <= e["end"]:0 &&
part["cylinders"]:0 <= e["cylinders"]:0 &&
(!e["extended"]:false && (size(lg["free_pnr"]:[])>0 || ! creation_needed ) ||
e["extended"]:false && size(lg["ext_pnr"]:[])>0)
)
part["cylinders"]:0 <= e["cylinders"]:0 )
{
map llg = (map) eval(lg);

Expand Down Expand Up @@ -1628,6 +1621,8 @@ global map AddFilesysData( map st_map, map xml_map )
}
pnr = pnr + 1;
}
if( isempty(free_pnr) )
ret["extended_possible"] = false;
ret["free_pnr"] = free_pnr;
list<integer> ext_pnr = [ 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,
25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,
Expand Down

0 comments on commit be29165

Please sign in to comment.