[gparted] Add comment about needing to compute encryption overhead in activate_format()



commit 578ebf133ef073d284bad2f864b38cb6fdebfbc1
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Wed Jan 10 16:27:54 2018 +0000

    Add comment about needing to compute encryption overhead in activate_format()
    
    To explain why just using the size of the LUKS header won't always be
    correct.

 src/Win_GParted.cc |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc
index 2bbdf97..f1739fe 100644
--- a/src/Win_GParted.cc
+++ b/src/Win_GParted.cc
@@ -2313,6 +2313,10 @@ void Win_GParted::activate_format( FSType new_fs )
        if ( selected_partition_ptr->filesystem == FS_LUKS && selected_partition_ptr->busy )
        {
                encrypted = true;
+               // Calculate the actual overhead rather than just using the size of the
+               // LUKS header so that correct limits are reported in cases when the
+               // active LUKS mapping doesn't extend to the end of the partition for this
+               // format file system only operation.
                Byte_Value encryption_overhead = selected_partition_ptr->get_byte_length() -
                                                 filesystem_ptn.get_byte_length();
                fs_limits.min_size += encryption_overhead;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]