block-5.10-2020-11-13

-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEEwPw5LcreJtl1+l5K99NY+ylx4KYFAl+u+FMQHGF4Ym9lQGtl
 cm5lbC5kawAKCRD301j7KXHgpuqJD/4gTtMihQcgGPEFg/2aaJr/uu27nQYhDuAZ
 wG1qKl/KyH/3HnxNgjQi8YvCMdiuvmNq+RubU8XWEb2zhlJSw2rpC2zVAPqmxdtX
 ByJFcRef/o/6zxcfp1nllycmrla8v5ok8045I6MKsT4NJMoFwGxe+4quS/SfHC+z
 QL3tSe8ZbDxtHhucajJM3sXUUFmNkap0DFF/nDwagBep7vQoxZrlFnPb/j0ufy37
 xa7k0mY2uaLGa4nZ7OFhhZQKe8/8NLsDrxpGPhugZC2DxfHRuVOMunjr7YNOhXET
 WlD/HlxcqUHAoIITMiHK+9YZBSaTd4+O5HrfodxmdmOHvw4d3t/YnmaD1HGq4cvL
 4djrxDtbzPDUPqzWVgsHQEnE16JQmVh0jbfDNNY7o8UydX7fZWvOCrjzLDwe3PFW
 /R9MgivTg0P8wmnPxWSd4Qxfo44e7O1tRpjw6dVvtmoYSpFQCwjDoqjoZ55jBEb6
 4ALHd13VivydPQKFMyEQ95FrMNnjoruOnCC0jdPXcR18e7K743HrE87hcBc/kZER
 6/JGGThWaUWM/+RxtTUfGDVa1Ex3HUuhLdhnD0lL4tIYklx4UscECEtKx9W3qBRV
 P3XW5gd9GJoINAqbniB3ldaqOtvkGWElomLwlYDVQw25F/Ra5DLQTHg3naPxzaoa
 v9DaWYcvtQ==
 =mE3l
 -----END PGP SIGNATURE-----

Merge tag 'block-5.10-2020-11-13' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe:
 "A few small fixes:

   - NVMe pull request from Christoph:
        - don't clear the read-only bit on a revalidate (Sagi Grimberg)

   - nbd error case refcount leak (Christoph)

   - loop/generic uevent fix (Christoph, Petr)"

* tag 'block-5.10-2020-11-13' of git://git.kernel.dk/linux-block:
  loop: Fix occasional uevent drop
  block: add a return value to set_capacity_revalidate_and_notify
  nbd: fix a block_device refcount leak in nbd_release
  nvme: fix incorrect behavior when BLKROSET is called by the user
This commit is contained in:
Linus Torvalds 2020-11-13 15:09:52 -08:00
commit b5dea9c0ab
5 changed files with 8 additions and 5 deletions

View File

@ -49,7 +49,7 @@ static void disk_release_events(struct gendisk *disk);
* Set disk capacity and notify if the size is not currently
* zero and will not be set to zero
*/
void set_capacity_revalidate_and_notify(struct gendisk *disk, sector_t size,
bool set_capacity_revalidate_and_notify(struct gendisk *disk, sector_t size,
bool update_bdev)
{
sector_t capacity = get_capacity(disk);
@ -62,7 +62,10 @@ void set_capacity_revalidate_and_notify(struct gendisk *disk, sector_t size,
char *envp[] = { "RESIZE=1", NULL };
kobject_uevent_env(&disk_to_dev(disk)->kobj, KOBJ_CHANGE, envp);
return true;
}
return false;
}
EXPORT_SYMBOL_GPL(set_capacity_revalidate_and_notify);

View File

@ -255,7 +255,8 @@ static void loop_set_size(struct loop_device *lo, loff_t size)
bd_set_nr_sectors(bdev, size);
set_capacity_revalidate_and_notify(lo->lo_disk, size, false);
if (!set_capacity_revalidate_and_notify(lo->lo_disk, size, false))
kobject_uevent(&disk_to_dev(bdev->bd_disk)->kobj, KOBJ_CHANGE);
}
static inline int

View File

@ -1518,6 +1518,7 @@ static void nbd_release(struct gendisk *disk, fmode_t mode)
if (test_bit(NBD_RT_DISCONNECT_ON_CLOSE, &nbd->config->runtime_flags) &&
bdev->bd_openers == 0)
nbd_disconnect_and_put(nbd);
bdput(bdev);
nbd_config_put(nbd);
nbd_put(nbd);

View File

@ -2060,8 +2060,6 @@ static void nvme_update_disk_info(struct gendisk *disk,
if (id->nsattr & NVME_NS_ATTR_RO)
set_disk_ro(disk, true);
else
set_disk_ro(disk, false);
}
static inline bool nvme_first_scan(struct gendisk *disk)

View File

@ -315,7 +315,7 @@ static inline int get_disk_ro(struct gendisk *disk)
extern void disk_block_events(struct gendisk *disk);
extern void disk_unblock_events(struct gendisk *disk);
extern void disk_flush_events(struct gendisk *disk, unsigned int mask);
void set_capacity_revalidate_and_notify(struct gendisk *disk, sector_t size,
bool set_capacity_revalidate_and_notify(struct gendisk *disk, sector_t size,
bool update_bdev);
/* drivers/char/random.c */