Skip to content

Commit 00fff4d

Browse files
author
Kent Overstreet
committed
bcachefs: bios must be 512 byte algined
Fixes: 023f9ac bcachefs: Delete dio read alignment check Reported-by: Brian Foster <[email protected]> Signed-off-by: Kent Overstreet <[email protected]>
1 parent aead342 commit 00fff4d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fs/bcachefs/fs-io-direct.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ static int bch2_direct_IO_read(struct kiocb *req, struct iov_iter *iter)
7777

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

80+
/* bios must be 512 byte aligned: */
81+
if ((offset|iter->count) & (SECTOR_SIZE - 1))
82+
return -EINVAL;
83+
8084
ret = min_t(loff_t, iter->count,
8185
max_t(loff_t, 0, i_size_read(&inode->v) - offset));
8286

0 commit comments

Comments
 (0)