recover from write fd failed

when write  a part of info failed, buf_ should return to old state
This commit is contained in:
文佳鹏 2022-02-24 14:24:17 +08:00 committed by GitHub
parent 4fb146810c
commit 9fdb676bce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -307,6 +307,7 @@ class PosixWritableFile final : public WritableFile {
// Can't fit in buffer, so need to do at least one write.
Status status = FlushBuffer();
if (!status.ok()) {
pos_ -= copy_size;
return status;
}