Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+8 -5
+4 -1
block/genhd.c
··· 49 49 * Set disk capacity and notify if the size is not currently 50 50 * zero and will not be set to zero 51 51 */ 52 - void set_capacity_revalidate_and_notify(struct gendisk *disk, sector_t size, 52 + bool set_capacity_revalidate_and_notify(struct gendisk *disk, sector_t size, 53 53 bool update_bdev) 54 54 { 55 55 sector_t capacity = get_capacity(disk); ··· 62 62 char *envp[] = { "RESIZE=1", NULL }; 63 63 64 64 kobject_uevent_env(&disk_to_dev(disk)->kobj, KOBJ_CHANGE, envp); 65 + return true; 65 66 } 67 + 68 + return false; 66 69 } 67 70 68 71 EXPORT_SYMBOL_GPL(set_capacity_revalidate_and_notify);
+2 -1
drivers/block/loop.c
··· 255 255 256 256 bd_set_nr_sectors(bdev, size); 257 257 258 - set_capacity_revalidate_and_notify(lo->lo_disk, size, false); 258 + if (!set_capacity_revalidate_and_notify(lo->lo_disk, size, false)) 259 + kobject_uevent(&disk_to_dev(bdev->bd_disk)->kobj, KOBJ_CHANGE); 259 260 } 260 261 261 262 static inline int
+1
drivers/block/nbd.c
··· 1518 1518 if (test_bit(NBD_RT_DISCONNECT_ON_CLOSE, &nbd->config->runtime_flags) && 1519 1519 bdev->bd_openers == 0) 1520 1520 nbd_disconnect_and_put(nbd); 1521 + bdput(bdev); 1521 1522 1522 1523 nbd_config_put(nbd); 1523 1524 nbd_put(nbd);
-2
drivers/nvme/host/core.c
··· 2060 2060 2061 2061 if (id->nsattr & NVME_NS_ATTR_RO) 2062 2062 set_disk_ro(disk, true); 2063 - else 2064 - set_disk_ro(disk, false); 2065 2063 } 2066 2064 2067 2065 static inline bool nvme_first_scan(struct gendisk *disk)
+1 -1
include/linux/genhd.h
··· 315 315 extern void disk_block_events(struct gendisk *disk); 316 316 extern void disk_unblock_events(struct gendisk *disk); 317 317 extern void disk_flush_events(struct gendisk *disk, unsigned int mask); 318 - void set_capacity_revalidate_and_notify(struct gendisk *disk, sector_t size, 318 + bool set_capacity_revalidate_and_notify(struct gendisk *disk, sector_t size, 319 319 bool update_bdev); 320 320 321 321 /* drivers/char/random.c */