]> git.karo-electronics.de Git - karo-tx-linux.git/commit
dm table: clear add_random unless all devices have it set
authorMilan Broz <mbroz@redhat.com>
Wed, 26 Sep 2012 22:45:43 +0000 (23:45 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 10 Oct 2012 02:31:06 +0000 (03:31 +0100)
commite3dd7a09f14902688ae99eb8f3a49e3651147283
tree0a6c787ed39c487afbeb7321cfe3a19d8e4deb68
parent1bd6669684e5b889713164a76d42250afefdd1aa
dm table: clear add_random unless all devices have it set

commit c3c4555edd10dbc0b388a0125b9c50de5e79af05 upstream.

Always clear QUEUE_FLAG_ADD_RANDOM if any underlying device does not
have it set. Otherwise devices with predictable characteristics may
contribute entropy.

QUEUE_FLAG_ADD_RANDOM specifies whether or not queue IO timings
contribute to the random pool.

For bio-based targets this flag is always 0 because such devices have no
real queue.

For request-based devices this flag was always set to 1 by default.

Now set it according to the flags on underlying devices. If there is at
least one device which should not contribute, set the flag to zero: If a
device, such as fast SSD storage, is not suitable for supplying entropy,
a request-based queue stacked over it will not be either.

Because the checking logic is exactly same as for the rotational flag,
share the iteration function with device_is_nonrot().

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/md/dm-table.c