Skip to content
Commit ab73857e authored by Linus Torvalds's avatar Linus Torvalds
Browse files

direct-io: don't read inode->i_blkbits multiple times



Since directio can work on a raw block device, and the block size of the
device can change under it, we need to do the same thing that
fs/buffer.c now does: read the block size a single time, using
ACCESS_ONCE().

Reading it multiple times can get different results, which will then
confuse the code because it actually encodes the i_blksize in
relationship to the underlying logical blocksize.

Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1e8b3332
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment