History

Merge tag 'block-6.15-20250424' of git://git.kernel.dk/linux

Pull block fixes from Jens Axboe: - Fix autoloading of drivers from stat*(2) - Fix losing read-ahead setting one suspend/resume, when a device is re-probed. - Fix race between setting the block size and page cache updates. Includes a helper that a coming XFS fix will use as well. - ublk cancelation fixes. - ublk selftest additions and fixes. - NVMe pull via Christoph: - fix an out-of-bounds access in nvmet_enable_port (Richard Weinberger) * tag 'block-6.15-20250424' of git://git.kernel.dk/linux: ublk: fix race between io_uring_cmd_complete_in_task and ublk_cancel_cmd ublk: call ublk_dispatch_req() for handling UBLK_U_IO_NEED_GET_DATA block: don't autoload drivers on blk-cgroup configuration block: don't autoload drivers on stat block: remove the backing_inode variable in bdev_statx block: move blkdev_{get,put} _no_open prototypes out of blkdev.h block: never reduce ra_pages in blk_apply_bdi_limits selftests: ublk: common: fix _get_disk_dev_t for pre-9.0 coreutils selftests: ublk: remove useless 'delay_us' from 'struct dev_ctx' selftests: ublk: fix recover test block: hoist block size validation code to a separate function block: fix race between set_blocksize and read paths nvmet: fix out-of-bounds access in nvmet_enable_port

Linus Torvalds committed 1 year ago

Commit 7deea562 parents 0537fbb f40139f14 files · +121 −47Browse files

Unified · Split

14 files
  1. block/bdev.c +51 −16
  2. block/blk-cgroup.c +1 −1
  3. block/blk-settings.c +7 −1
  4. block/blk-zoned.c +4 −1
  5. block/blk.h +3 −0
  6. block/fops.c +17 −1
  7. block/ioctl.c +6 −0
  8. drivers/block/ublk_drv.c +24 −17
  9. drivers/nvme/target/core.c +3 −0
  10. include/linux/blkdev.h +1 −4
  11. tools/testing/selftests/ublk/kublk.c +1 −0
  12. tools/testing/selftests/ublk/kublk.h +0 −3
  13. tools/testing/selftests/ublk/test_common.sh +2 −2
  14. tools/testing/selftests/ublk/test_generic_05.sh +1 −1
block/bdev.c+51−16
@@ -152,27 +152,65 @@ static void set_init_blocksize(struct block_device *bdev) · 151 unmodified lines
152 get_order(bsize));152 get_order(bsize));
153}153}
154 154
155int set_blocksize(struct file *file, int size)155/**
156 * bdev_validate_blocksize - check that this block size is acceptable
157 * @bdev: blockdevice to check
158 * @block_size: block size to check
159 *
160 * For block device users that do not use buffer heads or the block device
161 * page cache, make sure that this block size can be used with the device.
162 *
163 * Return: On success zero is returned, negative error code on failure.
164 */
165int bdev_validate_blocksize(struct block_device *bdev, int block_size)
156{166{
157 struct inode *inode = file->f_mapping->host;167 if (blk_validate_block_size(block_size))
158 struct block_device *bdev = I_BDEV(inode);
159
160 if (blk_validate_block_size(size))
161 return -EINVAL;168 return -EINVAL;
162 169
163 /* Size cannot be smaller than the size supported by the device */170 /* Size cannot be smaller than the size supported by the device */
164 if (size < bdev_logical_block_size(bdev))171 if (block_size < bdev_logical_block_size(bdev))
165 return -EINVAL;172 return -EINVAL;
166 173
174 return 0;
175}
176EXPORT_SYMBOL_GPL(bdev_validate_blocksize);
177
178int set_blocksize(struct file *file, int size)
179{
180 struct inode *inode = file->f_mapping->host;
181 struct block_device *bdev = I_BDEV(inode);
182 int ret;
183
184 ret = bdev_validate_blocksize(bdev, size);
185 if (ret)
186 return ret;
187
167 if (!file->private_data)188 if (!file->private_data)
168 return -EINVAL;189 return -EINVAL;
169 190
170 /* Don't change the size if it is same as current */191 /* Don't change the size if it is same as current */
171 if (inode->i_blkbits != blksize_bits(size)) {192 if (inode->i_blkbits != blksize_bits(size)) {
193 /*
194 * Flush and truncate the pagecache before we reconfigure the
195 * mapping geometry because folio sizes are variable now. If a
196 * reader has already allocated a folio whose size is smaller
197 * than the new min_order but invokes readahead after the new
198 * min_order becomes visible, readahead will think there are
199 * "zero" blocks per folio and crash. Take the inode and
200 * invalidation locks to avoid racing with
201 * read/write/fallocate.
202 */
203 inode_lock(inode);
204 filemap_invalidate_lock(inode->i_mapping);
205
172 sync_blockdev(bdev);206 sync_blockdev(bdev);
207 kill_bdev(bdev);
208
173 inode->i_blkbits = blksize_bits(size);209 inode->i_blkbits = blksize_bits(size);
174 mapping_set_folio_min_order(inode->i_mapping, get_order(size));210 mapping_set_folio_min_order(inode->i_mapping, get_order(size));
175 kill_bdev(bdev);211 kill_bdev(bdev);
212 filemap_invalidate_unlock(inode->i_mapping);
213 inode_unlock(inode);
176 }214 }
177 return 0;215 return 0;
178}216}
@@ -777,13 +815,13 @@ static void blkdev_put_part(struct block_device *part) · 598 unmodified lines
777 blkdev_put_whole(whole);815 blkdev_put_whole(whole);
778}816}
779 817
780struct block_device *blkdev_get_no_open(dev_t dev)818struct block_device *blkdev_get_no_open(dev_t dev, bool autoload)
781{819{
782 struct block_device *bdev;820 struct block_device *bdev;
783 struct inode *inode;821 struct inode *inode;
784 822
785 inode = ilookup(blockdev_superblock, dev);823 inode = ilookup(blockdev_superblock, dev);
786 if (!inode && IS_ENABLED(CONFIG_BLOCK_LEGACY_AUTOLOAD)) {824 if (!inode && autoload && IS_ENABLED(CONFIG_BLOCK_LEGACY_AUTOLOAD)) {
787 blk_request_module(dev);825 blk_request_module(dev);
788 inode = ilookup(blockdev_superblock, dev);826 inode = ilookup(blockdev_superblock, dev);
789 if (inode)827 if (inode)
@@ -1005,7 +1043,7 @@ struct file *bdev_file_open_by_dev(dev_t dev, blk_mode_t mode, void *holder, · 215 unmodified lines
1005 if (ret)1043 if (ret)
1006 return ERR_PTR(ret);1044 return ERR_PTR(ret);
1007 1045
1008 bdev = blkdev_get_no_open(dev);1046 bdev = blkdev_get_no_open(dev, true);
1009 if (!bdev)1047 if (!bdev)
1010 return ERR_PTR(-ENXIO);1048 return ERR_PTR(-ENXIO);
1011 1049
@@ -1274,18 +1312,15 @@ void sync_bdevs(bool wait) · 262 unmodified lines
1274 */1312 */
1275void bdev_statx(const struct path *path, struct kstat *stat, u32 request_mask)1313void bdev_statx(const struct path *path, struct kstat *stat, u32 request_mask)
1276{1314{
1277 struct inode *backing_inode;
1278 struct block_device *bdev;1315 struct block_device *bdev;
1279 1316
1280 backing_inode = d_backing_inode(path->dentry);
1281
1282 /*1317 /*
1283 * Note that backing_inode is the inode of a block device node file,1318 * Note that d_backing_inode() returns the block device node inode, not
1284 * not the block device's internal inode. Therefore it is *not* valid1319 * the block device's internal inode. Therefore it is *not* valid to
1285 * to use I_BDEV() here; the block device has to be looked up by i_rdev1320 * use I_BDEV() here; the block device has to be looked up by i_rdev
1286 * instead.1321 * instead.
1287 */1322 */
1288 bdev = blkdev_get_no_open(backing_inode->i_rdev);1323 bdev = blkdev_get_no_open(d_backing_inode(path->dentry)->i_rdev, false);
1289 if (!bdev)1324 if (!bdev)
1290 return;1325 return;
1291 1326
block/blk-cgroup.c+1−1
@@ -797,7 +797,7 @@ int blkg_conf_open_bdev(struct blkg_conf_ctx *ctx) · 796 unmodified lines
797 return -EINVAL;797 return -EINVAL;
798 input = skip_spaces(input);798 input = skip_spaces(input);
799 799
800 bdev = blkdev_get_no_open(MKDEV(major, minor));800 bdev = blkdev_get_no_open(MKDEV(major, minor), false);
801 if (!bdev)801 if (!bdev)
802 return -ENODEV;802 return -ENODEV;
803 if (bdev_is_partition(bdev)) {803 if (bdev_is_partition(bdev)) {
block/blk-settings.c+7−1
@@ -61,8 +61,14 @@ void blk_apply_bdi_limits(struct backing_dev_info *bdi, · 60 unmodified lines
61 /*61 /*
62 * For read-ahead of large files to be effective, we need to read ahead62 * For read-ahead of large files to be effective, we need to read ahead
63 * at least twice the optimal I/O size.63 * at least twice the optimal I/O size.
64 *
65 * There is no hardware limitation for the read-ahead size and the user
66 * might have increased the read-ahead size through sysfs, so don't ever
67 * decrease it.
64 */68 */
65 bdi->ra_pages = max(lim->io_opt * 2 / PAGE_SIZE, VM_READAHEAD_PAGES);69 bdi->ra_pages = max3(bdi->ra_pages,
70 lim->io_opt * 2 / PAGE_SIZE,
71 VM_READAHEAD_PAGES);
66 bdi->io_pages = lim->max_sectors >> PAGE_SECTORS_SHIFT;72 bdi->io_pages = lim->max_sectors >> PAGE_SECTORS_SHIFT;
67}73}
68 74
block/blk-zoned.c+4−1
@@ -343,6 +343,7 @@ int blkdev_zone_mgmt_ioctl(struct block_device *bdev, blk_mode_t mode, · 342 unmodified lines
343 op = REQ_OP_ZONE_RESET;343 op = REQ_OP_ZONE_RESET;
344 344
345 /* Invalidate the page cache, including dirty pages. */345 /* Invalidate the page cache, including dirty pages. */
346 inode_lock(bdev->bd_mapping->host);
346 filemap_invalidate_lock(bdev->bd_mapping);347 filemap_invalidate_lock(bdev->bd_mapping);
347 ret = blkdev_truncate_zone_range(bdev, mode, &zrange);348 ret = blkdev_truncate_zone_range(bdev, mode, &zrange);
348 if (ret)349 if (ret)
@@ -364,8 +365,10 @@ int blkdev_zone_mgmt_ioctl(struct block_device *bdev, blk_mode_t mode, · 15 unmodified lines
364 ret = blkdev_zone_mgmt(bdev, op, zrange.sector, zrange.nr_sectors);365 ret = blkdev_zone_mgmt(bdev, op, zrange.sector, zrange.nr_sectors);
365 366
366fail:367fail:
367 if (cmd == BLKRESETZONE)368 if (cmd == BLKRESETZONE) {
368 filemap_invalidate_unlock(bdev->bd_mapping);369 filemap_invalidate_unlock(bdev->bd_mapping);
370 inode_unlock(bdev->bd_mapping->host);
371 }
369 372
370 return ret;373 return ret;
371}374}
block/blk.h+3−0
@@ -94,6 +94,9 @@ static inline void blk_wait_io(struct completion *done) · 93 unmodified lines
94 wait_for_completion_io(done);94 wait_for_completion_io(done);
95}95}
96 96
97struct block_device *blkdev_get_no_open(dev_t dev, bool autoload);
98void blkdev_put_no_open(struct block_device *bdev);
99
97#define BIO_INLINE_VECS 4100#define BIO_INLINE_VECS 4
98struct bio_vec *bvec_alloc(mempool_t *pool, unsigned short *nr_vecs,101struct bio_vec *bvec_alloc(mempool_t *pool, unsigned short *nr_vecs,
99 gfp_t gfp_mask);102 gfp_t gfp_mask);
block/fops.c+17−1
@@ -642,7 +642,7 @@ static int blkdev_open(struct inode *inode, struct file *filp) · 641 unmodified lines
642 if (ret)642 if (ret)
643 return ret;643 return ret;
644 644
645 bdev = blkdev_get_no_open(inode->i_rdev);645 bdev = blkdev_get_no_open(inode->i_rdev, true);
646 if (!bdev)646 if (!bdev)
647 return -ENXIO;647 return -ENXIO;
648 648
@@ -746,7 +746,14 @@ static ssize_t blkdev_write_iter(struct kiocb *iocb, struct iov_iter *from) · 97 unmodified lines
746 ret = direct_write_fallback(iocb, from, ret,746 ret = direct_write_fallback(iocb, from, ret,
747 blkdev_buffered_write(iocb, from));747 blkdev_buffered_write(iocb, from));
748 } else {748 } else {
749 /*
750 * Take i_rwsem and invalidate_lock to avoid racing with
751 * set_blocksize changing i_blkbits/folio order and punching
752 * out the pagecache.
753 */
754 inode_lock_shared(bd_inode);
749 ret = blkdev_buffered_write(iocb, from);755 ret = blkdev_buffered_write(iocb, from);
756 inode_unlock_shared(bd_inode);
750 }757 }
751 758
752 if (ret > 0)759 if (ret > 0)
@@ -757,6 +764,7 @@ static ssize_t blkdev_write_iter(struct kiocb *iocb, struct iov_iter *from) · 4 unmodified lines
757 764
758static ssize_t blkdev_read_iter(struct kiocb *iocb, struct iov_iter *to)765static ssize_t blkdev_read_iter(struct kiocb *iocb, struct iov_iter *to)
759{766{
767 struct inode *bd_inode = bdev_file_inode(iocb->ki_filp);
760 struct block_device *bdev = I_BDEV(iocb->ki_filp->f_mapping->host);768 struct block_device *bdev = I_BDEV(iocb->ki_filp->f_mapping->host);
761 loff_t size = bdev_nr_bytes(bdev);769 loff_t size = bdev_nr_bytes(bdev);
762 loff_t pos = iocb->ki_pos;770 loff_t pos = iocb->ki_pos;
@@ -793,7 +801,13 @@ static ssize_t blkdev_read_iter(struct kiocb *iocb, struct iov_iter *to) · 30 unmodified lines
793 goto reexpand;801 goto reexpand;
794 }802 }
795 803
804 /*
805 * Take i_rwsem and invalidate_lock to avoid racing with set_blocksize
806 * changing i_blkbits/folio order and punching out the pagecache.
807 */
808 inode_lock_shared(bd_inode);
796 ret = filemap_read(iocb, to, ret);809 ret = filemap_read(iocb, to, ret);
810 inode_unlock_shared(bd_inode);
797 811
798reexpand:812reexpand:
799 if (unlikely(shorted))813 if (unlikely(shorted))
@@ -836,6 +850,7 @@ static long blkdev_fallocate(struct file *file, int mode, loff_t start, · 36 unmodified lines
836 if ((start | len) & (bdev_logical_block_size(bdev) - 1))850 if ((start | len) & (bdev_logical_block_size(bdev) - 1))
837 return -EINVAL;851 return -EINVAL;
838 852
853 inode_lock(inode);
839 filemap_invalidate_lock(inode->i_mapping);854 filemap_invalidate_lock(inode->i_mapping);
840 855
841 /*856 /*
@@ -868,6 +883,7 @@ static long blkdev_fallocate(struct file *file, int mode, loff_t start, · 26 unmodified lines
868 883
869 fail:884 fail:
870 filemap_invalidate_unlock(inode->i_mapping);885 filemap_invalidate_unlock(inode->i_mapping);
886 inode_unlock(inode);
871 return error;887 return error;
872}888}
873 889
block/ioctl.c+6−0
@@ -142,6 +142,7 @@ static int blk_ioctl_discard(struct block_device *bdev, blk_mode_t mode, · 141 unmodified lines
142 if (err)142 if (err)
143 return err;143 return err;
144 144
145 inode_lock(bdev->bd_mapping->host);
145 filemap_invalidate_lock(bdev->bd_mapping);146 filemap_invalidate_lock(bdev->bd_mapping);
146 err = truncate_bdev_range(bdev, mode, start, start + len - 1);147 err = truncate_bdev_range(bdev, mode, start, start + len - 1);
147 if (err)148 if (err)
@@ -174,6 +175,7 @@ out_unplug: · 26 unmodified lines
174 blk_finish_plug(&plug);175 blk_finish_plug(&plug);
175fail:176fail:
176 filemap_invalidate_unlock(bdev->bd_mapping);177 filemap_invalidate_unlock(bdev->bd_mapping);
178 inode_unlock(bdev->bd_mapping->host);
177 return err;179 return err;
178}180}
179 181
@@ -199,12 +201,14 @@ static int blk_ioctl_secure_erase(struct block_device *bdev, blk_mode_t mode, · 19 unmodified lines
199 end > bdev_nr_bytes(bdev))201 end > bdev_nr_bytes(bdev))
200 return -EINVAL;202 return -EINVAL;
201 203
204 inode_lock(bdev->bd_mapping->host);
202 filemap_invalidate_lock(bdev->bd_mapping);205 filemap_invalidate_lock(bdev->bd_mapping);
203 err = truncate_bdev_range(bdev, mode, start, end - 1);206 err = truncate_bdev_range(bdev, mode, start, end - 1);
204 if (!err)207 if (!err)
205 err = blkdev_issue_secure_erase(bdev, start >> 9, len >> 9,208 err = blkdev_issue_secure_erase(bdev, start >> 9, len >> 9,
206 GFP_KERNEL);209 GFP_KERNEL);
207 filemap_invalidate_unlock(bdev->bd_mapping);210 filemap_invalidate_unlock(bdev->bd_mapping);
211 inode_unlock(bdev->bd_mapping->host);
208 return err;212 return err;
209}213}
210 214
@@ -236,6 +240,7 @@ static int blk_ioctl_zeroout(struct block_device *bdev, blk_mode_t mode, · 25 unmodified lines
236 return -EINVAL;240 return -EINVAL;
237 241
238 /* Invalidate the page cache, including dirty pages */242 /* Invalidate the page cache, including dirty pages */
243 inode_lock(bdev->bd_mapping->host);
239 filemap_invalidate_lock(bdev->bd_mapping);244 filemap_invalidate_lock(bdev->bd_mapping);
240 err = truncate_bdev_range(bdev, mode, start, end);245 err = truncate_bdev_range(bdev, mode, start, end);
241 if (err)246 if (err)
@@ -246,6 +251,7 @@ static int blk_ioctl_zeroout(struct block_device *bdev, blk_mode_t mode, · 4 unmodified lines
246 251
247fail:252fail:
248 filemap_invalidate_unlock(bdev->bd_mapping);253 filemap_invalidate_unlock(bdev->bd_mapping);
254 inode_unlock(bdev->bd_mapping->host);
249 return err;255 return err;
250}256}
251 257
drivers/block/ublk_drv.c+24−17
@@ -1683,14 +1683,31 @@ static void ublk_start_cancel(struct ublk_queue *ubq) · 1682 unmodified lines
1683 ublk_put_disk(disk);1683 ublk_put_disk(disk);
1684}1684}
1685 1685
1686static void ublk_cancel_cmd(struct ublk_queue *ubq, struct ublk_io *io,1686static void ublk_cancel_cmd(struct ublk_queue *ubq, unsigned tag,
1687 unsigned int issue_flags)1687 unsigned int issue_flags)
1688{1688{
1689 struct ublk_io *io = &ubq->ios[tag];
1690 struct ublk_device *ub = ubq->dev;
1691 struct request *req;
1689 bool done;1692 bool done;
1690 1693
1691 if (!(io->flags & UBLK_IO_FLAG_ACTIVE))1694 if (!(io->flags & UBLK_IO_FLAG_ACTIVE))
1692 return;1695 return;
1693 1696
1697 /*
1698 * Don't try to cancel this command if the request is started for
1699 * avoiding race between io_uring_cmd_done() and
1700 * io_uring_cmd_complete_in_task().
1701 *
1702 * Either the started request will be aborted via __ublk_abort_rq(),
1703 * then this uring_cmd is canceled next time, or it will be done in
1704 * task work function ublk_dispatch_req() because io_uring guarantees
1705 * that ublk_dispatch_req() is always called
1706 */
1707 req = blk_mq_tag_to_rq(ub->tag_set.tags[ubq->q_id], tag);
1708 if (req && blk_mq_request_started(req))
1709 return;
1710
1694 spin_lock(&ubq->cancel_lock);1711 spin_lock(&ubq->cancel_lock);
1695 done = !!(io->flags & UBLK_IO_FLAG_CANCELED);1712 done = !!(io->flags & UBLK_IO_FLAG_CANCELED);
1696 if (!done)1713 if (!done)
@@ -1722,7 +1739,6 @@ static void ublk_uring_cmd_cancel_fn(struct io_uring_cmd *cmd, · 25 unmodified lines
1722 struct ublk_uring_cmd_pdu *pdu = ublk_get_uring_cmd_pdu(cmd);1739 struct ublk_uring_cmd_pdu *pdu = ublk_get_uring_cmd_pdu(cmd);
1723 struct ublk_queue *ubq = pdu->ubq;1740 struct ublk_queue *ubq = pdu->ubq;
1724 struct task_struct *task;1741 struct task_struct *task;
1725 struct ublk_io *io;
1726 1742
1727 if (WARN_ON_ONCE(!ubq))1743 if (WARN_ON_ONCE(!ubq))
1728 return;1744 return;
@@ -1737,9 +1753,8 @@ static void ublk_uring_cmd_cancel_fn(struct io_uring_cmd *cmd, · 8 unmodified lines
1737 if (!ubq->canceling)1753 if (!ubq->canceling)
1738 ublk_start_cancel(ubq);1754 ublk_start_cancel(ubq);
1739 1755
1740 io = &ubq->ios[pdu->tag];1756 WARN_ON_ONCE(ubq->ios[pdu->tag].cmd != cmd);
1741 WARN_ON_ONCE(io->cmd != cmd);1757 ublk_cancel_cmd(ubq, pdu->tag, issue_flags);
1742 ublk_cancel_cmd(ubq, io, issue_flags);
1743}1758}
1744 1759
1745static inline bool ublk_queue_ready(struct ublk_queue *ubq)1760static inline bool ublk_queue_ready(struct ublk_queue *ubq)
@@ -1752,7 +1767,7 @@ static void ublk_cancel_queue(struct ublk_queue *ubq) · 6 unmodified lines
1752 int i;1767 int i;
1753 1768
1754 for (i = 0; i < ubq->q_depth; i++)1769 for (i = 0; i < ubq->q_depth; i++)
1755 ublk_cancel_cmd(ubq, &ubq->ios[i], IO_URING_F_UNLOCKED);1770 ublk_cancel_cmd(ubq, i, IO_URING_F_UNLOCKED);
1756}1771}
1757 1772
1758/* Cancel all pending commands, must be called after del_gendisk() returns */1773/* Cancel all pending commands, must be called after del_gendisk() returns */
@@ -1886,15 +1901,6 @@ static void ublk_mark_io_ready(struct ublk_device *ub, struct ublk_queue *ubq) · 127 unmodified lines
1886 }1901 }
1887}1902}
1888 1903
1889static void ublk_handle_need_get_data(struct ublk_device *ub, int q_id,
1890 int tag)
1891{
1892 struct ublk_queue *ubq = ublk_get_queue(ub, q_id);
1893 struct request *req = blk_mq_tag_to_rq(ub->tag_set.tags[q_id], tag);
1894
1895 ublk_queue_cmd(ubq, req);
1896}
1897
1898static inline int ublk_check_cmd_op(u32 cmd_op)1904static inline int ublk_check_cmd_op(u32 cmd_op)
1899{1905{
1900 u32 ioc_type = _IOC_TYPE(cmd_op);1906 u32 ioc_type = _IOC_TYPE(cmd_op);
@@ -2103,8 +2109,9 @@ static int __ublk_ch_uring_cmd(struct io_uring_cmd *cmd, · 202 unmodified lines
2103 if (!(io->flags & UBLK_IO_FLAG_OWNED_BY_SRV))2109 if (!(io->flags & UBLK_IO_FLAG_OWNED_BY_SRV))
2104 goto out;2110 goto out;
2105 ublk_fill_io_cmd(io, cmd, ub_cmd->addr);2111 ublk_fill_io_cmd(io, cmd, ub_cmd->addr);
2106 ublk_handle_need_get_data(ub, ub_cmd->q_id, ub_cmd->tag);2112 req = blk_mq_tag_to_rq(ub->tag_set.tags[ub_cmd->q_id], tag);
2107 break;2113 ublk_dispatch_req(ubq, req, issue_flags);
2114 return -EIOCBQUEUED;
2108 default:2115 default:
2109 goto out;2116 goto out;
2110 }2117 }
drivers/nvme/target/core.c+3−0
@@ -324,6 +324,9 @@ int nvmet_enable_port(struct nvmet_port *port) · 323 unmodified lines
324 324
325 lockdep_assert_held(&nvmet_config_sem);325 lockdep_assert_held(&nvmet_config_sem);
326 326
327 if (port->disc_addr.trtype == NVMF_TRTYPE_MAX)
328 return -EINVAL;
329
327 ops = nvmet_transports[port->disc_addr.trtype];330 ops = nvmet_transports[port->disc_addr.trtype];
328 if (!ops) {331 if (!ops) {
329 up_write(&nvmet_config_sem);332 up_write(&nvmet_config_sem);
include/linux/blkdev.h+1−4
@@ -1637,6 +1637,7 @@ static inline void bio_end_io_acct(struct bio *bio, unsigned long start_time) · 1636 unmodified lines
1637 return bio_end_io_acct_remapped(bio, start_time, bio->bi_bdev);1637 return bio_end_io_acct_remapped(bio, start_time, bio->bi_bdev);
1638}1638}
1639 1639
1640int bdev_validate_blocksize(struct block_device *bdev, int block_size);
1640int set_blocksize(struct file *file, int size);1641int set_blocksize(struct file *file, int size);
1641 1642
1642int lookup_bdev(const char *pathname, dev_t *dev);1643int lookup_bdev(const char *pathname, dev_t *dev);
@@ -1693,10 +1694,6 @@ int bd_prepare_to_claim(struct block_device *bdev, void *holder, · 50 unmodified lines
1693 const struct blk_holder_ops *hops);1694 const struct blk_holder_ops *hops);
1694void bd_abort_claiming(struct block_device *bdev, void *holder);1695void bd_abort_claiming(struct block_device *bdev, void *holder);
1695 1696
1696/* just for blk-cgroup, don't use elsewhere */
1697struct block_device *blkdev_get_no_open(dev_t dev);
1698void blkdev_put_no_open(struct block_device *bdev);
1699
1700struct block_device *I_BDEV(struct inode *inode);1697struct block_device *I_BDEV(struct inode *inode);
1701struct block_device *file_bdev(struct file *bdev_file);1698struct block_device *file_bdev(struct file *bdev_file);
1702bool disk_live(struct gendisk *disk);1699bool disk_live(struct gendisk *disk);
tools/testing/selftests/ublk/kublk.c+1−0
@@ -1354,6 +1354,7 @@ int main(int argc, char *argv[]) · 1353 unmodified lines
1354 value = strtol(optarg, NULL, 10);1354 value = strtol(optarg, NULL, 10);
1355 if (value)1355 if (value)
1356 ctx.flags |= UBLK_F_NEED_GET_DATA;1356 ctx.flags |= UBLK_F_NEED_GET_DATA;
1357 break;
1357 case 0:1358 case 0:
1358 if (!strcmp(longopts[option_idx].name, "debug_mask"))1359 if (!strcmp(longopts[option_idx].name, "debug_mask"))
1359 ublk_dbg_mask = strtol(optarg, NULL, 16);1360 ublk_dbg_mask = strtol(optarg, NULL, 16);
tools/testing/selftests/ublk/kublk.h+0−3
@@ -86,9 +86,6 @@ struct dev_ctx { · 85 unmodified lines
86 unsigned int fg:1;86 unsigned int fg:1;
87 unsigned int recovery:1;87 unsigned int recovery:1;
88 88
89 /* fault_inject */
90 long long delay_us;
91
92 int _evtfd;89 int _evtfd;
93 int _shmid;90 int _shmid;
94 91
tools/testing/selftests/ublk/test_common.sh+2−2
@@ -17,8 +17,8 @@ _get_disk_dev_t() { · 16 unmodified lines
17 local minor17 local minor
18 18
19 dev=/dev/ublkb"${dev_id}"19 dev=/dev/ublkb"${dev_id}"
20 major=$(stat -c '%Hr' "$dev")20 major="0x"$(stat -c '%t' "$dev")
21 minor=$(stat -c '%Lr' "$dev")21 minor="0x"$(stat -c '%T' "$dev")
22 22
23 echo $(( (major & 0xfff) << 20 | (minor & 0xfffff) ))23 echo $(( (major & 0xfff) << 20 | (minor & 0xfffff) ))
24}24}
tools/testing/selftests/ublk/test_generic_05.sh+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
3 3
4. "$(cd "$(dirname "$0")" && pwd)"/test_common.sh4. "$(cd "$(dirname "$0")" && pwd)"/test_common.sh
5 5
6TID="generic_04"6TID="generic_05"
7ERR_CODE=07ERR_CODE=0
8 8
9ublk_run_recover_test()9ublk_run_recover_test()

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t