• Linus Torvalds's avatar
    direct-io: don't read inode->i_blkbits multiple times · ab73857e
    Linus Torvalds authored
    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>
    ab73857e
direct-io.c 37.4 KB