Prevent file system grow when partition grow fails (#686668)

Prior to this enhancement, GParted ignored the status of the partition
grow operation, and attempted to grow the file system.

Now we check the status of the partition grow operation prior to
growing the file system.

Part of Bug #686668 - Growing logical partition overlaps end of
                      extended partition
This commit is contained in:
Curtis Gedak 2012-11-25 13:20:56 -07:00 committed by Mike Fleetwood
parent c17959e200
commit fd96328920
1 changed files with 8 additions and 10 deletions

View File

@ -2246,16 +2246,14 @@ bool GParted_Core::resize( const Partition & partition_old,
succes = resize_move_partition( partition_old, partition_new, operationdetail ) ; succes = resize_move_partition( partition_old, partition_new, operationdetail ) ;
//expand file system to fit exactly in partition //expand file system to fit exactly in partition
if ( ! ( //Do not maximize file system if FS not linux-swap and new size <= old if ( succes
( partition_new .filesystem != FS_LINUX_SWAP //linux-swap is recreated, not resized && ( //Maximize file system if FS not linux-swap and new size > old
&& partition_new .get_sector_length() <= partition_old .get_sector_length() partition_new .filesystem != FS_LINUX_SWAP //linux-swap is recreated, not resized
) && partition_new .get_sector_length() > partition_old .get_sector_length()
|| ( check_repair_filesystem( partition_new, operationdetail )
&& maximize_filesystem( partition_new, operationdetail )
) )
) )
) succes = check_repair_filesystem( partition_new, operationdetail )
succes = false ; && maximize_filesystem( partition_new, operationdetail ) ;
return succes ; return succes ;
} }