]> git.baikalelectronics.ru Git - kernel.git/commit
dm: mark targets that pass integrity data
authorMikulas Patocka <mpatocka@redhat.com>
Tue, 18 Apr 2017 20:51:48 +0000 (16:51 -0400)
committerMike Snitzer <snitzer@redhat.com>
Mon, 24 Apr 2017 16:04:32 +0000 (12:04 -0400)
commitac76b416642e9b362b67b69bbd0587c0f8f5543f
tree61cf54345c7bca5844099f29abf0aa7da53135e8
parente3a8cd283911ff1bc05a5b2cea7aa2254cd68d50
dm: mark targets that pass integrity data

A dm-crypt on dm-integrity device incorrectly advertises an integrity
profile on the DM crypt device.  It can be seen in the files
"/sys/block/dm-*/integrity/*" that both dm-integrity and dm-crypt target
advertise the integrity profile.  That is incorrect, only the
dm-integrity target should advertise the integrity profile.

A general problem in DM is that if we have a DM device that depends on
another device with an integrity profile, the upper device will always
advertise the integrity profile, even when the target driver doesn't
support handling integrity data.

Most targets don't support integrity data, so we provide a whitelist of
targets that support it (linear, delay and striped).  The targets that
support passing integrity data to the lower device are marked with the
flag DM_TARGET_PASSES_INTEGRITY.  The DM core will now advertise
integrity data on a DM device only if all the targets support the
integrity data.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-delay.c
drivers/md/dm-linear.c
drivers/md/dm-stripe.c
drivers/md/dm-table.c
drivers/md/dm.c
include/linux/device-mapper.h