summaryrefslogtreecommitdiff
path: root/drivers/md/dm-verity.c
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2012-10-12 16:59:46 +0100
committerAlasdair G Kergon <agk@redhat.com>2012-10-12 16:59:46 +0100
commitfe5fe90639b62a75349dd1f1c74c4a984397171c (patch)
tree50332fca2fb4ff5851c4e1bfd8151d41ba83d781 /drivers/md/dm-verity.c
parent54499afbb80e44ae5511984486b4b33d6229fceb (diff)
dm: use ACCESS_ONCE for sysfs values
Use the ACCESS_ONCE macro in dm-bufio and dm-verity where a variable can be modified asynchronously (through sysfs) and we want to prevent compiler optimizations that assume that the variable hasn't changed. (See Documentation/atomic_ops.txt.) Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-verity.c')
-rw-r--r--drivers/md/dm-verity.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-verity.c b/drivers/md/dm-verity.c
index 892ae2766aa6..9e7328bb4030 100644
--- a/drivers/md/dm-verity.c
+++ b/drivers/md/dm-verity.c
@@ -438,7 +438,7 @@ static void verity_prefetch_io(struct dm_verity *v, struct dm_verity_io *io)
verity_hash_at_level(v, io->block, i, &hash_block_start, NULL);
verity_hash_at_level(v, io->block + io->n_blocks - 1, i, &hash_block_end, NULL);
if (!i) {
- unsigned cluster = *(volatile unsigned *)&dm_verity_prefetch_cluster;
+ unsigned cluster = ACCESS_ONCE(dm_verity_prefetch_cluster);
cluster >>= v->data_dev_block_bits;
if (unlikely(!cluster))