}
// and make sure our xattr is durable.
- ::fsync(fd);
+ r = ::fsync(fd);
+ if (r < 0) {
+ derr << __func__ << " fsync failed: " << cpp_strerror(errno) << dendl;
+ ceph_abort();
+ }
_inject_failure();
_inject_failure();
// first make sure the previous operation commits
- ::fsync(fd);
+ int r = ::fsync(fd);
+ if (r < 0) {
+ derr << __func__ << " fsync failed: " << cpp_strerror(errno) << dendl;
+ ceph_abort();
+ }
if (!in_progress) {
// sync object_map too. even if this object has a header or keys,
bufferlist v(40);
encode(spos, v);
encode(in_progress, v);
- int r = chain_fsetxattr<true, true>(
+ r = chain_fsetxattr<true, true>(
fd, REPLAY_GUARD_XATTR, v.c_str(), v.length());
if (r < 0) {
derr << "fsetxattr " << REPLAY_GUARD_XATTR << " got " << cpp_strerror(r) << dendl;
}
// and make sure our xattr is durable.
- ::fsync(fd);
+ r = ::fsync(fd);
+ if (r < 0) {
+ derr << __func__ << " fsync failed: " << cpp_strerror(errno) << dendl;
+ ceph_abort();
+ }
_inject_failure();
}
// and make sure our xattr is durable.
- ::fsync(fd);
+ r = ::fsync(fd);
+ if (r < 0) {
+ derr << __func__ << " fsync failed: " << cpp_strerror(errno) << dendl;
+ ceph_abort();
+ }
_inject_failure();
#include "common/debug.h"
#include "include/buffer.h"
#include "common/ceph_crypto.h"
+#include "common/errno.h"
#include "include/compat.h"
#include "chain_xattr.h"
maybe_inject_failure();
int r = ::fsync(fd);
maybe_inject_failure();
- if (r < 0)
- return -errno;
- else
- return 0;
+ if (r < 0) {
+ derr << __func__ << " fsync failed: " << cpp_strerror(errno) << dendl;
+ ceph_abort();
+ }
+ return 0;
}
int LFNIndex::link_object(const vector<string> &from,
#include "os/filestore/WBThrottle.h"
#include "common/perf_counters.h"
+#include "common/errno.h"
WBThrottle::WBThrottle(CephContext *cct) :
cur_ios(0), cur_size(0),
logger->inc(l_wbthrottle_inodes_wb);
lock.Unlock();
#if defined(HAVE_FDATASYNC)
- ::fdatasync(**wb.get<1>());
+ int r = ::fdatasync(**wb.get<1>());
#else
- ::fsync(**wb.get<1>());
+ int r = ::fsync(**wb.get<1>());
#endif
+ if (r < 0) {
+ lderr(cct) << "WBThrottle fsync failed: " << cpp_strerror(errno) << dendl;
+ ceph_abort();
+ }
#ifdef HAVE_POSIX_FADVISE
if (cct->_conf->filestore_fadvise && wb.get<2>().nocache) {
int fa_r = posix_fadvise(**wb.get<1>(), 0, 0, POSIX_FADV_DONTNEED);