]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: read inode size after acquiring the mutex when punching a hole
authorFilipe Manana <fdmanana@gmail.com>
Sat, 26 Apr 2014 00:35:31 +0000 (01:35 +0100)
committerChris Mason <clm@fb.com>
Tue, 10 Jun 2014 00:20:24 +0000 (17:20 -0700)
commit073fb3a95dead0c62cfa6abbba0d8d5c9bb0ffc6
tree78460ac0f6e86d31174f15d018ef4c2ec87286fc
parent9a0d6ae8f44d7333136a677a52cf1b16e85ea033
Btrfs: read inode size after acquiring the mutex when punching a hole

In a previous change, commit e8eadf37e4cb3361857d7d952b3c2ed66b578edf,
I accidentally moved the roundup of inode->i_size to outside of the
critical section delimited by the inode mutex, which is not atomic and
not correct since the size can be changed by other task before we acquire
the mutex. Therefore fix it.

Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/file.c