]> git.baikalelectronics.ru Git - kernel.git/commit
block: Fix discard topology stacking and reporting
authorMartin K. Petersen <martin.petersen@oracle.com>
Wed, 18 May 2011 08:37:35 +0000 (10:37 +0200)
committerJens Axboe <jaxboe@fusionio.com>
Wed, 18 May 2011 08:37:35 +0000 (10:37 +0200)
commit29b0921f05ad5f752e18a5e1ec00c1e97270a23a
treeb3f82d7b0a6c34c4d449debd2d1d242bdbf84b56
parent3f0057d3dae63620d1323c2aca4a75a76b13b9b6
block: Fix discard topology stacking and reporting

In some cases we would end up stacking discard_zeroes_data incorrectly.
Fix this by enabling the feature by default for stacking drivers and
clearing it for low-level drivers. Incorporating a device that does not
support dzd will then cause the feature to be disabled in the stacking
driver.

Also ensure that the maximum discard value does not overflow when
exported in sysfs and return 0 in the alignment and dzd fields for
devices that don't support discard.

Reported-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
block/blk-settings.c
block/blk-sysfs.c
include/linux/blkdev.h