Skip to content

Commit

Permalink
bcachefs: bios must be 512 byte algined
Browse files Browse the repository at this point in the history
Fixes: 023f9ac bcachefs: Delete dio read alignment check
Reported-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
  • Loading branch information
Kent Overstreet authored and intelfx committed Aug 15, 2024
1 parent a06cf7e commit f4002a2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/bcachefs/fs-io-direct.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ static int bch2_direct_IO_read(struct kiocb *req, struct iov_iter *iter)

bch2_inode_opts_get(&opts, c, &inode->ei_inode);

/* bios must be 512 byte aligned: */
if ((offset|iter->count) & (SECTOR_SIZE - 1))
return -EINVAL;

ret = min_t(loff_t, iter->count,
max_t(loff_t, 0, i_size_read(&inode->v) - offset));

Expand Down

0 comments on commit f4002a2

Please sign in to comment.