Skip to content

Commit 1e83e39

Browse files
author
CKI KWF Bot
committed
Merge: block: chery pick for 9.8
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/7339 block: chery pick for 9.8 JIRA: https://issues.redhat.com/browse/RHEL-112997 JIRA: https://issues.redhat.com/browse/RHEL-111097 Omitted-fix: 68477b5 ("ksmbd: fix rename failure") Omitted-fix: 48b47f0 ("ksmbd: fix uninitialized pointer read in ksmbd_vfs_rename()") Omitted-fix: df14afe ("ksmbd: fix uninitialized pointer read in smb2_create_link()") Omitted-fix: 6fe55c2 ("ksmbd: call putname after using the last component") Omitted-fix: 2b57a43 ("ksmbd: check if a mount point is crossed during path lookup") Omitted-fix: af74e5f ("tools headers: Update the VFS headers with the kernel sources") Omitted-fix: d072148 ("fs: add a FMODE_ flag to indicate IOCB_HAS_METADATA availability") All ksmbd commits just touch ksmbd code, which isn't supported on rhel9. The headers update patches covers too many kernel change, can't pulled in in this MR. The last omitted fix is dropped because it has been in Jeff's io-uring update, for avoiding conflicts. Omitted-fix: d8b90e6 ("ext4: add ext4_sb_bread_nofail() helper function for ext4_free_branches()") The above fix will be pulled in after the whole MR is merged, which is one trival fix for page allocation failure in case of ext3. Omitted-fix: e66ccd3 ("VFS: discard err2 in filename_create()") The above isn't a bug fix, just a false positive. Try to update with upstream, however the gap has been bigger, especially some fs/block interface, and many refactor patches can't be pulled in because FS isn't updated. Signed-off-by: Ming Lei <ming.lei@redhat.com> Approved-by: Jeff Moyer <jmoyer@redhat.com> Approved-by: Maurizio Lombardi <mlombard@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
2 parents 2f925dd + 0816628 commit 1e83e39

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+2853
-2016
lines changed

Documentation/ABI/stable/sysfs-block

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ Contact: Martin K. Petersen <martin.petersen@oracle.com>
9393
Description:
9494
Indicates whether a storage device is capable of storing
9595
integrity metadata. Set if the device is T10 PI-capable.
96+
This flag is set to 1 if the storage media is formatted
97+
with T10 Protection Information. If the storage media is
98+
not formatted with T10 Protection Information, this flag
99+
is set to 0.
96100

97101

98102
What: /sys/block/<disk>/integrity/format
@@ -101,6 +105,13 @@ Contact: Martin K. Petersen <martin.petersen@oracle.com>
101105
Description:
102106
Metadata format for integrity capable block device.
103107
E.g. T10-DIF-TYPE1-CRC.
108+
This field describes the type of T10 Protection Information
109+
that the block device can send and receive.
110+
If the device can store application integrity metadata but
111+
no T10 Protection Information profile is used, this field
112+
contains "nop".
113+
If the device does not support integrity metadata, this
114+
field contains "none".
104115

105116

106117
What: /sys/block/<disk>/integrity/protection_interval_bytes
@@ -126,7 +137,17 @@ Date: June 2008
126137
Contact: Martin K. Petersen <martin.petersen@oracle.com>
127138
Description:
128139
Number of bytes of integrity tag space available per
129-
512 bytes of data.
140+
protection_interval_bytes, which is typically
141+
the device's logical block size.
142+
This field describes the size of the application tag
143+
if the storage device is formatted with T10 Protection
144+
Information and permits use of the application tag.
145+
The tag_size is reported in bytes and indicates the
146+
space available for adding an opaque tag to each block
147+
(protection_interval_bytes).
148+
If the device does not support T10 Protection Information
149+
(even if the device provides application integrity
150+
metadata space), this field is set to 0.
130151

131152

132153
What: /sys/block/<disk>/integrity/write_generate
@@ -445,6 +466,21 @@ Description:
445466
zone commands, they will be treated as regular block
446467
devices and zoned will report "none".
447468

469+
What: /sys/block/<disk>/queue/max_write_streams
470+
Date: November 2024
471+
Contact: linux-block@vger.kernel.org
472+
Description:
473+
[RO] Maximum number of write streams supported, 0 if not
474+
supported. If supported, valid values are 1 through
475+
max_write_streams, inclusive.
476+
477+
What: /sys/block/<disk>/queue/write_stream_granularity
478+
Date: November 2024
479+
Contact: linux-block@vger.kernel.org
480+
Description:
481+
[RO] Granularity of a write stream in bytes. The granularity
482+
of a write stream is the size that should be discarded or
483+
overwritten together to avoid write amplification in the device.
448484

449485
What: /sys/block/<disk>/stat
450486
Date: February 2008

Documentation/filesystems/porting.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -977,3 +977,24 @@ Anyone iterating through the list of children needs to be aware of the
977977
half-killed dentries that might be seen there; taking ->d_lock on those will
978978
see them negative, unhashed and with negative refcount, which means that most
979979
of the in-kernel users would've done the right thing anyway without any adjustment.
980+
981+
---
982+
983+
** recommended**
984+
985+
kern_path_locked() and user_path_locked() no longer return a negative
986+
dentry so this doesn't need to be checked. If the name cannot be found,
987+
ERR_PTR(-ENOENT) is returned.
988+
989+
** recommend**
990+
991+
lookup_one_qstr_excl() is changed to return errors in more cases, so
992+
these conditions don't require explicit checks:
993+
994+
- if LOOKUP_CREATE is NOT given, then the dentry won't be negative,
995+
ERR_PTR(-ENOENT) is returned instead
996+
- if LOOKUP_EXCL IS given, then the dentry won't be positive,
997+
ERR_PTR(-EEXIST) is rreturned instread
998+
999+
LOOKUP_EXCL now means "target must not exist". It can be combined with
1000+
LOOK_CREATE or LOOKUP_RENAME_TARGET.

block/Kconfig

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,6 @@ source "block/partitions/Kconfig"
214214
config BLOCK_COMPAT
215215
def_bool COMPAT
216216

217-
config BLK_MQ_PCI
218-
def_bool PCI
219-
220-
config BLK_MQ_VIRTIO
221-
bool
222-
depends on VIRTIO
223-
default y
224-
225217
config BLK_PM
226218
def_bool PM
227219

block/Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
obj-y := bdev.o fops.o bio.o elevator.o blk-core.o blk-sysfs.o \
77
blk-flush.o blk-settings.o blk-ioc.o blk-map.o \
8-
blk-merge.o blk-timeout.o \
9-
blk-lib.o blk-mq.o blk-mq-tag.o blk-stat.o \
8+
blk-merge.o blk-timeout.o blk-lib.o blk-mq.o \
9+
blk-mq-tag.o blk-mq-dma.o blk-stat.o \
1010
blk-mq-sysfs.o blk-mq-cpumap.o blk-mq-sched.o ioctl.o \
1111
genhd.o ioprio.o badblocks.o partitions/ blk-rq-qos.o \
1212
disk-events.o blk-ia-ranges.o early-lookup.o
@@ -26,7 +26,8 @@ obj-$(CONFIG_MQ_IOSCHED_KYBER) += kyber-iosched.o
2626
bfq-y := bfq-iosched.o bfq-wf2q.o bfq-cgroup.o
2727
obj-$(CONFIG_IOSCHED_BFQ) += bfq.o
2828

29-
obj-$(CONFIG_BLK_DEV_INTEGRITY) += bio-integrity.o blk-integrity.o t10-pi.o
29+
obj-$(CONFIG_BLK_DEV_INTEGRITY) += bio-integrity.o blk-integrity.o t10-pi.o \
30+
bio-integrity-auto.o
3031
obj-$(CONFIG_BLK_DEV_ZONED) += blk-zoned.o
3132
obj-$(CONFIG_BLK_WBT) += blk-wbt.o
3233
obj-$(CONFIG_BLK_DEBUG_FS) += blk-mq-debugfs.o

block/bdev.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -745,13 +745,13 @@ static void blkdev_put_part(struct block_device *part)
745745
blkdev_put_whole(whole);
746746
}
747747

748-
struct block_device *blkdev_get_no_open(dev_t dev)
748+
struct block_device *blkdev_get_no_open(dev_t dev, bool autoload)
749749
{
750750
struct block_device *bdev;
751751
struct inode *inode;
752752

753753
inode = ilookup(blockdev_superblock, dev);
754-
if (!inode && IS_ENABLED(CONFIG_BLOCK_LEGACY_AUTOLOAD)) {
754+
if (!inode && autoload && IS_ENABLED(CONFIG_BLOCK_LEGACY_AUTOLOAD)) {
755755
blk_request_module(dev);
756756
inode = ilookup(blockdev_superblock, dev);
757757
if (inode)
@@ -1031,7 +1031,7 @@ struct file *bdev_file_open_by_dev(dev_t dev, blk_mode_t mode, void *holder,
10311031
if (ret)
10321032
return ERR_PTR(ret);
10331033

1034-
bdev = blkdev_get_no_open(dev);
1034+
bdev = blkdev_get_no_open(dev, true);
10351035
if (!bdev)
10361036
return ERR_PTR(-ENXIO);
10371037

@@ -1241,8 +1241,7 @@ void sync_bdevs(bool wait)
12411241
/*
12421242
* Handle STATX_{DIOALIGN, WRITE_ATOMIC} for block devices.
12431243
*/
1244-
void bdev_statx(struct inode *backing_inode, struct kstat *stat,
1245-
u32 request_mask)
1244+
void bdev_statx(const struct path *path, struct kstat *stat, u32 request_mask)
12461245
{
12471246
struct block_device *bdev;
12481247

@@ -1252,7 +1251,7 @@ void bdev_statx(struct inode *backing_inode, struct kstat *stat,
12521251
* to use I_BDEV() here; the block device has to be looked up by i_rdev
12531252
* instead.
12541253
*/
1255-
bdev = blkdev_get_no_open(backing_inode->i_rdev);
1254+
bdev = blkdev_get_no_open(d_backing_inode(path->dentry)->i_rdev, false);
12561255
if (!bdev)
12571256
return;
12581257

block/bfq-iosched.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7210,8 +7210,8 @@ static void bfq_exit_queue(struct elevator_queue *e)
72107210
#endif
72117211

72127212
blk_stat_disable_accounting(bfqd->queue);
7213-
clear_bit(ELEVATOR_FLAG_DISABLE_WBT, &e->flags);
7214-
wbt_enable_default(bfqd->queue->disk);
7213+
blk_queue_flag_clear(QUEUE_FLAG_DISABLE_WBT_DEF, bfqd->queue);
7214+
set_bit(ELEVATOR_FLAG_ENABLE_WBT_ON_EXIT, &e->flags);
72157215

72167216
kfree(bfqd);
72177217
}
@@ -7398,7 +7398,7 @@ static int bfq_init_queue(struct request_queue *q, struct elevator_type *e)
73987398
/* We dispatch from request queue wide instead of hw queue */
73997399
blk_queue_flag_set(QUEUE_FLAG_SQ_SCHED, q);
74007400

7401-
set_bit(ELEVATOR_FLAG_DISABLE_WBT, &eq->flags);
7401+
blk_queue_flag_set(QUEUE_FLAG_DISABLE_WBT_DEF, q);
74027402
wbt_disable_default(q->disk);
74037403
blk_stat_enable_accounting(q);
74047404

0 commit comments

Comments
 (0)