Skip to content

Commit cd27e45

Browse files
author
Al Viro
committed
[btrfs] fix check_direct_IO() for non-iovec iterators
looking for duplicate ->iov_base makes sense only for iovec-backed iterators; for kvec-backed ones it's pointless, for bvec-backed ones it's pointless and broken on 32bit (we walk through an array of struct bio_vec accessing them as if they were struct iovec; works by accident on 64bit, but on 32bit it'll blow up) and for pipe-backed ones it's pointless and ends up oopsing. Signed-off-by: Al Viro <[email protected]>
1 parent b57332b commit cd27e45

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: fs/btrfs/inode.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -8618,7 +8618,7 @@ static ssize_t check_direct_IO(struct btrfs_root *root, struct kiocb *iocb,
86188618
goto out;
86198619

86208620
/* If this is a write we don't need to check anymore */
8621-
if (iov_iter_rw(iter) == WRITE)
8621+
if (iov_iter_rw(iter) != READ || !iter_is_iovec(iter))
86228622
return 0;
86238623
/*
86248624
* Check to make sure we don't have duplicate iov_base's in this

0 commit comments

Comments
 (0)