From: Varada Kari Date: Wed, 29 Jun 2016 13:12:24 +0000 (+0530) Subject: os/bluestore/BlueFS: Make fysnc return the status X-Git-Tag: v11.0.1~891^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=a579e06784139ac577a29b8f0437593850369213;p=ceph-ci.git os/bluestore/BlueFS: Make fysnc return the status Signed-off-by: Varada Kari --- diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index 61f9388d8e8..a13ed441622 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -1322,10 +1322,12 @@ int BlueFS::_truncate(FileWriter *h, uint64_t offset) return 0; } -void BlueFS::_fsync(FileWriter *h, std::unique_lock& l) +int BlueFS::_fsync(FileWriter *h, std::unique_lock& l) { dout(10) << __func__ << " " << h << " " << h->file->fnode << dendl; - _flush(h, true); + int r = _flush(h, true); + if (r < 0) + return r; uint64_t old_dirty_seq = h->file->dirty_seq; lock.unlock(); wait_for_aio(h); @@ -1338,6 +1340,7 @@ void BlueFS::_fsync(FileWriter *h, std::unique_lock& l) assert(h->file->dirty_seq == 0 || // cleaned h->file->dirty_seq > s); // or redirtied by someone else } + return 0; } void BlueFS::flush_bdev() diff --git a/src/os/bluestore/BlueFS.h b/src/os/bluestore/BlueFS.h index ac07e1c3868..aaeba43b81e 100644 --- a/src/os/bluestore/BlueFS.h +++ b/src/os/bluestore/BlueFS.h @@ -236,7 +236,7 @@ private: int _flush_range(FileWriter *h, uint64_t offset, uint64_t length); int _flush(FileWriter *h, bool force); void wait_for_aio(FileWriter *h); // safe to call without a lock - void _fsync(FileWriter *h, std::unique_lock& l); + int _fsync(FileWriter *h, std::unique_lock& l); int _flush_and_sync_log(std::unique_lock& l, uint64_t want_seq = 0); @@ -359,9 +359,9 @@ public: std::lock_guard l(lock); _flush_range(h, offset, length); } - void fsync(FileWriter *h) { + int fsync(FileWriter *h) { std::unique_lock l(lock); - _fsync(h, l); + return _fsync(h, l); } int read(FileReader *h, FileReaderBuffer *buf, uint64_t offset, size_t len, bufferlist *outbl, char *out) {