Files
linux/drivers/md
Heinz Mauelshagen 513f8da83b dm raid: ensure superblock's size matches device's logical block size
commit 40d43c4b4c upstream.

The dm-raid superblock (struct dm_raid_superblock) is padded to 512
bytes and that size is being used to read it in from the metadata
device into one preallocated page.

Reading or writing this on a 512-byte sector device works fine but on
a 4096-byte sector device this fails.

Set the dm-raid superblock's size to the logical block size of the
metadata device, because IO at that size is guaranteed too work.  Also
add a size check to avoid silent partial metadata loss in case the
superblock should ever grow past the logical block size or PAGE_SIZE.

[includes pointer math fix from Dan Carpenter]
Reported-by: "Liuhua Wang" <lwang@suse.com>
Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-21 09:22:53 -08:00
..
2014-02-06 11:08:16 -08:00
2013-04-24 11:42:41 +10:00
2013-03-01 22:45:51 +00:00
2013-03-01 22:45:51 +00:00
2013-03-01 22:45:51 +00:00
2014-02-13 13:48:02 -08:00
2013-03-01 22:45:47 +00:00
2014-02-13 13:48:02 -08:00
2014-02-13 13:48:02 -08:00
2013-03-23 14:15:29 -07:00
2014-02-13 13:48:02 -08:00
2013-03-23 14:15:29 -07:00
2014-02-13 13:48:02 -08:00