]> git.baikalelectronics.ru Git - kernel.git/commit
direct-io: don't read inode->i_blkbits multiple times
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 29 Nov 2012 20:27:00 +0000 (12:27 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 29 Nov 2012 20:38:44 +0000 (12:38 -0800)
commit0675a6e2908f32624421f8e6baaccfde1854cb2c
treede5b6fec7caec530f0dd72c9394a1a7d0b6f9878
parent848c1acb760274e8fcd0cadbbdadf817f4f9c69c
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: Linus Torvalds <torvalds@linux-foundation.org>
fs/direct-io.c