Skip to content

Commit

Permalink
Merge pull request #48279 from ifed01/wip-ifed-fix-57688
Browse files Browse the repository at this point in the history
quincy: os/bluestore: use direct write in BlueStore::_write_bdev_label

Reviewed-by: Adam Kupczyk <akupczyk@ibm.com>
  • Loading branch information
ifed01 committed Aug 11, 2023
2 parents 965fa97 + 4b6c034 commit 4345431
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/os/bluestore/BlueStore.cc
Expand Up @@ -5394,13 +5394,14 @@ int BlueStore::_write_bdev_label(CephContext *cct,
z.zero();
bl.append(std::move(z));

int fd = TEMP_FAILURE_RETRY(::open(path.c_str(), O_WRONLY|O_CLOEXEC));
int fd = TEMP_FAILURE_RETRY(::open(path.c_str(), O_WRONLY|O_CLOEXEC|O_DIRECT));
if (fd < 0) {
fd = -errno;
derr << __func__ << " failed to open " << path << ": " << cpp_strerror(fd)
<< dendl;
return fd;
}
bl.rebuild_aligned_size_and_memory(BDEV_LABEL_BLOCK_SIZE, BDEV_LABEL_BLOCK_SIZE, IOV_MAX);
int r = bl.write_fd(fd);
if (r < 0) {
derr << __func__ << " failed to write to " << path
Expand Down

0 comments on commit 4345431

Please sign in to comment.