Skip to content

Commit 0daa75b

Browse files
committed
Revert "block: nbd: add sanity check for first_minor"
This reverts commit 4b21d4e which is commit b1a8116 upstream. The backport of this is reported to be causing some problems, so revert this for now until they are worked out. Link: https://lore.kernel.org/r/CACPK8XfUWoOHr-0RwRoYoskia4fbAbZ7DYf5wWBnv6qUnGq18w@mail.gmail.com Reported-by: Joel Stanley <joel@jms.id.au> Cc: Christoph Hellwig <hch@lst.de> Cc: Pavel Skripkin <paskripkin@gmail.com> Cc: Jens Axboe <axboe@kernel.dk> Cc: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d3c3f4e commit 0daa75b

1 file changed

Lines changed: 0 additions & 10 deletions

File tree

‎drivers/block/nbd.c‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1759,17 +1759,7 @@ static int nbd_dev_add(int index)
17591759
refcount_set(&nbd->refs, 1);
17601760
INIT_LIST_HEAD(&nbd->list);
17611761
disk->major = NBD_MAJOR;
1762-
1763-
/* Too big first_minor can cause duplicate creation of
1764-
* sysfs files/links, since first_minor will be truncated to
1765-
* byte in __device_add_disk().
1766-
*/
17671762
disk->first_minor = index << part_shift;
1768-
if (disk->first_minor > 0xff) {
1769-
err = -EINVAL;
1770-
goto out_free_idr;
1771-
}
1772-
17731763
disk->fops = &nbd_fops;
17741764
disk->private_data = nbd;
17751765
sprintf(disk->disk_name, "nbd%d", index);

0 commit comments

Comments
 (0)