master - fsadm: add luks specific error message for small devices
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=6df7917581eea9eef3cf5144a870df9207be15df Commit: 6df7917581eea9eef3cf5144a870df9207be15df Parent: 888dd33148563e95b2b3faac98f6c6dd5f00a60a Author: Ondrej Kozina <[email protected]> AuthorDate: Mon Oct 23 15:31:44 2017 +0200 Committer: Ondrej Kozina <[email protected]> CommitterDate: Tue Oct 24 13:40:50 2017 +0200
fsadm: add luks specific error message for small devices
--- scripts/fsadm.sh | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
scripts/fsadm.sh +4 -0
@@ -581,6 +581,10 @@ resize_luks() { error "New size is not sector alligned" fi + if [ $((NEWBLOCKCOUNT - CRYPT_DATA_OFFSET)) -lt 1 ]; then + error "New size is smaller than minimum ($(((CRYPT_DATA_OFFSET + 1) * 512)) bytes) for LUKS device $VOLUME" + fi + NEWCBLOCKCOUNT=$((NEWBLOCKCOUNT - CRYPT_DATA_OFFSET)) NEWFSIZE=$(( NEWCBLOCKCOUNT * 512))