diff options
author | Sami Tolvanen <samitolvanen@google.com> | 2015-06-09 23:38:58 +0200 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-06-09 23:38:58 +0200 |
commit | 1692fc8bcba768cedd8bd5cc2a9875d354df1fcd (patch) | |
tree | 5999b4abeaa280a75a2b8eb67a301b3d1739bac2 | |
parent | am 7baa13f6: am 3f9db6af: Merge "recovery: Switch to clang" (diff) | |
parent | am 69608fe7: Merge "Zero blocks before BLKDISCARD" (diff) | |
download | android_bootable_recovery-1692fc8bcba768cedd8bd5cc2a9875d354df1fcd.tar android_bootable_recovery-1692fc8bcba768cedd8bd5cc2a9875d354df1fcd.tar.gz android_bootable_recovery-1692fc8bcba768cedd8bd5cc2a9875d354df1fcd.tar.bz2 android_bootable_recovery-1692fc8bcba768cedd8bd5cc2a9875d354df1fcd.tar.lz android_bootable_recovery-1692fc8bcba768cedd8bd5cc2a9875d354df1fcd.tar.xz android_bootable_recovery-1692fc8bcba768cedd8bd5cc2a9875d354df1fcd.tar.zst android_bootable_recovery-1692fc8bcba768cedd8bd5cc2a9875d354df1fcd.zip |
-rw-r--r-- | updater/blockimg.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/updater/blockimg.c b/updater/blockimg.c index 5d0f1560c..dfba7e420 100644 --- a/updater/blockimg.c +++ b/updater/blockimg.c @@ -39,11 +39,6 @@ #define BLOCKSIZE 4096 -// Set this to 0 to interpret 'erase' transfers to mean do a -// BLKDISCARD ioctl (the normal behavior). Set to 1 to interpret -// erase to mean fill the region with zeroes. -#define DEBUG_ERASE 0 - #ifndef BLKDISCARD #define BLKDISCARD _IO(0x12,119) #endif @@ -1283,8 +1278,7 @@ static int PerformCommandZero(CommandParameters* params) { } if (params->cmdname[0] == 'z') { - // Update only for the zero command, as the erase command will call - // this if DEBUG_ERASE is defined. + // Update only for the zero command, as the erase command will call this params->written += tgt->size; } @@ -1470,8 +1464,10 @@ static int PerformCommandErase(CommandParameters* params) { struct stat st; uint64_t blocks[2]; - if (DEBUG_ERASE) { - return PerformCommandZero(params); + // Always zero the blocks first to work around possibly flaky BLKDISCARD + // Bug: 20881595 + if (PerformCommandZero(params) != 0) { + goto pceout; } if (!params) { |