]> git.baikalelectronics.ru Git - kernel.git/commit
dm: use i_size_read
authorMikulas Patocka <mpatocka@redhat.com>
Mon, 22 Jun 2009 09:12:14 +0000 (10:12 +0100)
committerAlasdair G Kergon <agk@redhat.com>
Mon, 22 Jun 2009 09:12:14 +0000 (10:12 +0100)
commit7883afdd3e3429f07f8627bbcb3b67d6c0293ba6
tree7817e1bd6c9b721be85fe54a1aec6ef971d7d96b
parent489b267e522bd7243bb1628677fd363e94083250
dm: use i_size_read

Use i_size_read() instead of reading i_size.

If someone changes the size of the device simultaneously, i_size_read
is guaranteed to return a valid value (either the old one or the new one).

i_size can return some intermediate invalid value (on 32-bit computers
with 64-bit i_size, the reads to both halves of i_size can be interleaved
with updates to i_size, resulting in garbage being returned).

Cc: stable@kernel.org
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
drivers/md/dm-exception-store.h
drivers/md/dm-log.c
drivers/md/dm-table.c