dm: use i_size_read
commit1a8fdf7190c4986c4e5e782211462afd8ce25c5b
authorMikulas Patocka <mpatocka@redhat.com>
Mon, 22 Jun 2009 09:12:14 +0000 (22 10:12 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 2 Jul 2009 23:50:51 +0000 (2 16:50 -0700)
tree5da6b8d35dd6d25140f44829aa6447e98b961ec3
parentbac9d5bcb7666d4d6429b4dd00dc8f19295046a9
dm: use i_size_read

commit 5657e8fa45cf230df278040c420fb80e06309d8f upstream.

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).

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/md/dm-exception-store.h
drivers/md/dm-log.c
drivers/md/dm-table.c