mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
bcachefs: Fix failure to return error on misaligned dio write
This was reported as an error when running coreutils shred. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
83208cbf2f
commit
7b038b564b
@ -609,8 +609,10 @@ ssize_t bch2_direct_write(struct kiocb *req, struct iov_iter *iter)
|
||||
if (unlikely(ret))
|
||||
goto err_put_write_ref;
|
||||
|
||||
if (unlikely((req->ki_pos|iter->count) & (block_bytes(c) - 1)))
|
||||
if (unlikely((req->ki_pos|iter->count) & (block_bytes(c) - 1))) {
|
||||
ret = -EINVAL;
|
||||
goto err_put_write_ref;
|
||||
}
|
||||
|
||||
inode_dio_begin(&inode->v);
|
||||
bch2_pagecache_block_get(inode);
|
||||
|
Loading…
Reference in New Issue
Block a user