}
// 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();