Skip to content

Commit

Permalink
Merge pull request ceph#11146 from tchaikov/wip-17307
Browse files Browse the repository at this point in the history
os/filestore/FileJournal: error out if FileJournal is not a file

Reviewed-by: David Zafman <[email protected]>
  • Loading branch information
tchaikov authored Sep 21, 2016
2 parents cbe2700 + 7431eec commit 2718e0f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/os/filestore/FileJournal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,17 @@ int FileJournal::_open(bool forwrite, bool create)

if (S_ISBLK(st.st_mode)) {
ret = _open_block_device();
} else {
} else if (S_ISREG(st.st_mode)) {
if (aio && !force_aio) {
derr << "FileJournal::_open: disabling aio for non-block journal. Use "
<< "journal_force_aio to force use of aio anyway" << dendl;
aio = false;
}
ret = _open_file(st.st_size, st.st_blksize, create);
} else {
derr << "FileJournal::_open: wrong journal file type: " << st.st_mode
<< dendl;
ret = -EINVAL;
}

if (ret)
Expand Down Expand Up @@ -134,6 +138,7 @@ int FileJournal::_open(bool forwrite, bool create)

out_fd:
VOID_TEMP_FAILURE_RETRY(::close(fd));
fd = -1;
return ret;
}

Expand Down

0 comments on commit 2718e0f

Please sign in to comment.