Merge "Fix ext4/metadata/udc issue"

This commit is contained in:
Paul Lawrence 2019-08-27 15:21:58 +00:00 committed by Gerrit Code Review
commit 8c8ce02e2e
2 changed files with 7 additions and 3 deletions

View file

@ -244,7 +244,8 @@ std::string DmTargetCrypt::GetParameterString() const {
}
std::string DmTargetDefaultKey::GetParameterString() const {
return cipher_ + " " + key_ + " " + blockdev_ + " " + std::to_string(start_sector_);
return cipher_ + " " + key_ + " " + blockdev_ + " " + std::to_string(start_sector_) +
(set_dun_ ? " 1 set_dun" : "");
}
} // namespace dm

View file

@ -280,12 +280,14 @@ class DmTargetCrypt final : public DmTarget {
class DmTargetDefaultKey final : public DmTarget {
public:
DmTargetDefaultKey(uint64_t start, uint64_t length, const std::string& cipher,
const std::string& key, const std::string& blockdev, uint64_t start_sector)
const std::string& key, const std::string& blockdev, uint64_t start_sector,
bool set_dun = false)
: DmTarget(start, length),
cipher_(cipher),
key_(key),
blockdev_(blockdev),
start_sector_(start_sector) {}
start_sector_(start_sector),
set_dun_(set_dun) {}
std::string name() const override { return "default-key"; }
bool Valid() const override { return true; }
@ -296,6 +298,7 @@ class DmTargetDefaultKey final : public DmTarget {
std::string key_;
std::string blockdev_;
uint64_t start_sector_;
bool set_dun_;
};
} // namespace dm