block-5.7-2020-05-22

-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEEwPw5LcreJtl1+l5K99NY+ylx4KYFAl7IBtAQHGF4Ym9lQGtl
 cm5lbC5kawAKCRD301j7KXHgpl6yEAC2PiQwyQS5ZGw/gSEuHXYmoRTdqPz1Q3MP
 U3fzwqrat+WWtdeRsyReDGKMVkgJYtPA2aVKtv4BrMVpW+5ShK0az3IqzHc7kUjq
 ktEqWcmtXft/CFcYpLz8hyBNuflkU/qIQ6pJMPzzCOjoX5pADiigMGCe77FLCDK2
 LnaJyryNKGSQyYO1YD8EOdV/yAUw8FiUcXXBb4v3EbYpaoFqK7vmK9wJfBfHDpcI
 15P0clirNDbdZkjbrcaF5GExwh86RJswSUn+fzXF2nuIJDV0Iqecp9mFNeIRvbHd
 bHpCrSsTKZarq/D0ObCrM633F7AKz5R2OO8RZe8C5kRpmiTiqSFixKcG77wI9+oO
 ovZmX+AZWXsmrlYAM1HJqHMn7NHGBsUXFvPmxz6mE7NYrw4SVUkbzBA3egQN20iE
 NVEkNSjhRJhmogMeIs26G5qtr4c/g/dmSROxRYHjQNIfbFJBW/AsyvOBOVi37Yxv
 RUsek8J71IdhzYJr+b4aNkqZvgxUlSLGUDOMFMkk0hlNhdQ/K99y5rJxE06+gmdl
 6MaOdmd7U/hOpybsxobkWCJ718KohVId1gEnQFap2tvAe2WPAgXPlrCnYd1vQpFm
 /c5qdiMNOf7A8QQ8mq/cYnQfw1ncY1dUThrOsoJ96TBBx7i/M5oM/ZjBqVaWDU4r
 TkuEEUjaNw==
 =yyR2
 -----END PGP SIGNATURE-----

Merge tag 'block-5.7-2020-05-22' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe:
 "Two fixes for null_blk zone mode"

* tag 'block-5.7-2020-05-22' of git://git.kernel.dk/linux-block:
  null_blk: don't allow discard for zoned mode
  null_blk: return error for invalid zone size
This commit is contained in:
Linus Torvalds 2020-05-22 11:10:42 -07:00
commit db9f384785
2 changed files with 11 additions and 0 deletions

View File

@ -1535,6 +1535,13 @@ static void null_config_discard(struct nullb *nullb)
{
if (nullb->dev->discard == false)
return;
if (nullb->dev->zoned) {
nullb->dev->discard = false;
pr_info("discard option is ignored in zoned mode\n");
return;
}
nullb->q->limits.discard_granularity = nullb->dev->blocksize;
nullb->q->limits.discard_alignment = nullb->dev->blocksize;
blk_queue_max_discard_sectors(nullb->q, UINT_MAX >> 9);

View File

@ -23,6 +23,10 @@ int null_init_zoned_dev(struct nullb_device *dev, struct request_queue *q)
pr_err("zone_size must be power-of-two\n");
return -EINVAL;
}
if (dev->zone_size > dev->size) {
pr_err("Zone size larger than device capacity\n");
return -EINVAL;
}
dev->zone_size_sects = dev->zone_size << ZONE_SIZE_SHIFT;
dev->nr_zones = dev_size >>