crypt_check_data_device_size() needs to compare values in bytes
authorMilan Broz <gmazyland@gmail.com>
Mon, 22 Aug 2011 21:53:59 +0000 (21:53 +0000)
committerMilan Broz <gmazyland@gmail.com>
Mon, 22 Aug 2011 21:53:59 +0000 (21:53 +0000)
(Thanks to okozina@redhat.com)

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@602 36d66b0a-2a48-0410-832c-cd162a569da5

lib/setup.c

index 1e5b5ae0538be1d0ffc47e744d688360bed93cfe..b28451402d8dcc1d3cbca37fab426d93c9f67c16 100644 (file)
@@ -512,7 +512,7 @@ static int crypt_check_data_device_size(struct crypt_device *cd)
        uint64_t size, size_min;
 
        /* Check data device size, require at least one sector */
-       size_min = crypt_get_data_offset(cd) ?: SECTOR_SIZE;
+       size_min = crypt_get_data_offset(cd) << SECTOR_SHIFT ?: SECTOR_SIZE;
 
        r = device_size(crypt_get_device_name(cd), &size);
        if (r < 0)