Alignment must be a multiple of page size. At least currently.
if (r < 0)
return -errno;
max_size = st.st_size;
- block_size = st.st_blksize;
+ block_size = MAX(st.st_blksize, PAGE_SIZE);
if (max_size == 0) {
// hmm, is this a raw block device?
<< block_size << " (required for direct_io journal mode)" << dendl;
err = -EINVAL;
}
+ if ((header.alignment % PAGE_SIZE) && directio) {
+ derr(0) << "open journal alignment " << header.alignment << " is not multiple of page size " << PAGE_SIZE
+ << " (required for direct_io journal mode)" << dendl;
+ err = -EINVAL;
+ }
if (err)
return err;