Skip to content

Commit 222f5d8

Browse files
committed
Merge: block layer: several bug fixes
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/92 JIRA: https://issues.redhat.com/browse/RHEL-50740 JIRA: https://issues.redhat.com/browse/RHEL-67720 JIRA: https://issues.redhat.com/browse/RHEL-70861 JIRA: https://issues.redhat.com/browse/RHEL-65631 Signed-off-by: Ming Lei <ming.lei@redhat.com> Approved-by: Jeff Moyer <jmoyer@redhat.com> Approved-by: Ewan D. Milne <emilne@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Jan Stancek <jstancek@redhat.com>
2 parents c3dcf11 + 2f0a828 commit 222f5d8

File tree

7 files changed

+38
-5
lines changed

7 files changed

+38
-5
lines changed

block/bfq-cgroup.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,7 @@ static void bfq_sync_bfqq_move(struct bfq_data *bfqd,
736736
*/
737737
bfq_put_cooperator(sync_bfqq);
738738
bic_set_bfqq(bic, NULL, true, act_idx);
739+
bfq_release_process_ref(bfqd, sync_bfqq);
739740
}
740741
}
741742

block/bfq-iosched.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5434,8 +5434,6 @@ void bfq_put_cooperator(struct bfq_queue *bfqq)
54345434
bfq_put_queue(__bfqq);
54355435
__bfqq = next;
54365436
}
5437-
5438-
bfq_release_process_ref(bfqq->bfqd, bfqq);
54395437
}
54405438

54415439
static void bfq_exit_bfqq(struct bfq_data *bfqd, struct bfq_queue *bfqq)
@@ -5448,6 +5446,8 @@ static void bfq_exit_bfqq(struct bfq_data *bfqd, struct bfq_queue *bfqq)
54485446
bfq_log_bfqq(bfqd, bfqq, "exit_bfqq: %p, %d", bfqq, bfqq->ref);
54495447

54505448
bfq_put_cooperator(bfqq);
5449+
5450+
bfq_release_process_ref(bfqd, bfqq);
54515451
}
54525452

54535453
static void bfq_exit_icq_bfqq(struct bfq_io_cq *bic, bool is_sync,
@@ -6734,6 +6734,8 @@ bfq_split_bfqq(struct bfq_io_cq *bic, struct bfq_queue *bfqq)
67346734
bic_set_bfqq(bic, NULL, true, bfqq->actuator_idx);
67356735

67366736
bfq_put_cooperator(bfqq);
6737+
6738+
bfq_release_process_ref(bfqq->bfqd, bfqq);
67376739
return NULL;
67386740
}
67396741

block/sed-opal.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3037,6 +3037,29 @@ static int opal_set_new_pw(struct opal_dev *dev, struct opal_new_pw *opal_pw)
30373037
return ret;
30383038
}
30393039

3040+
static int opal_set_new_sid_pw(struct opal_dev *dev, struct opal_new_pw *opal_pw)
3041+
{
3042+
int ret;
3043+
struct opal_key *newkey = &opal_pw->new_user_pw.opal_key;
3044+
struct opal_key *oldkey = &opal_pw->session.opal_key;
3045+
3046+
const struct opal_step pw_steps[] = {
3047+
{ start_SIDASP_opal_session, oldkey },
3048+
{ set_sid_cpin_pin, newkey },
3049+
{ end_opal_session, }
3050+
};
3051+
3052+
if (!dev)
3053+
return -ENODEV;
3054+
3055+
mutex_lock(&dev->dev_lock);
3056+
setup_opal_dev(dev);
3057+
ret = execute_steps(dev, pw_steps, ARRAY_SIZE(pw_steps));
3058+
mutex_unlock(&dev->dev_lock);
3059+
3060+
return ret;
3061+
}
3062+
30403063
static int opal_activate_user(struct opal_dev *dev,
30413064
struct opal_session_info *opal_session)
30423065
{
@@ -3286,6 +3309,9 @@ int sed_ioctl(struct opal_dev *dev, unsigned int cmd, void __user *arg)
32863309
case IOC_OPAL_DISCOVERY:
32873310
ret = opal_get_discv(dev, p);
32883311
break;
3312+
case IOC_OPAL_SET_SID_PW:
3313+
ret = opal_set_new_sid_pw(dev, p);
3314+
break;
32893315

32903316
default:
32913317
break;

drivers/block/loop.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ static loff_t get_loop_size(struct loop_device *lo, struct file *file)
173173
static bool lo_bdev_can_use_dio(struct loop_device *lo,
174174
struct block_device *backing_bdev)
175175
{
176-
unsigned short sb_bsize = bdev_logical_block_size(backing_bdev);
176+
unsigned int sb_bsize = bdev_logical_block_size(backing_bdev);
177177

178178
if (queue_logical_block_size(lo->lo_queue) < sb_bsize)
179179
return false;
@@ -977,7 +977,7 @@ loop_set_status_from_info(struct loop_device *lo,
977977
return 0;
978978
}
979979

980-
static unsigned short loop_default_blocksize(struct loop_device *lo,
980+
static unsigned int loop_default_blocksize(struct loop_device *lo,
981981
struct block_device *backing_bdev)
982982
{
983983
/* In case of direct I/O, match underlying block size */
@@ -986,7 +986,7 @@ static unsigned short loop_default_blocksize(struct loop_device *lo,
986986
return SECTOR_SIZE;
987987
}
988988

989-
static int loop_reconfigure_limits(struct loop_device *lo, unsigned short bsize)
989+
static int loop_reconfigure_limits(struct loop_device *lo, unsigned int bsize)
990990
{
991991
struct file *file = lo->lo_backing_file;
992992
struct inode *inode = file->f_mapping->host;

drivers/block/ublk_drv.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2996,6 +2996,8 @@ static int __init ublk_init(void)
29962996
{
29972997
int ret;
29982998

2999+
mark_tech_preview("ublk", NULL);
3000+
29993001
BUILD_BUG_ON((u64)UBLKSRV_IO_BUF_OFFSET +
30003002
UBLKSRV_IO_BUF_TOTAL_SIZE < UBLKSRV_IO_BUF_OFFSET);
30013003

include/linux/sed-opal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ static inline bool is_sed_ioctl(unsigned int cmd)
5252
case IOC_OPAL_GET_GEOMETRY:
5353
case IOC_OPAL_DISCOVERY:
5454
case IOC_OPAL_REVERT_LSP:
55+
case IOC_OPAL_SET_SID_PW:
5556
return true;
5657
}
5758
return false;

include/uapi/linux/sed-opal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,5 +215,6 @@ struct opal_revert_lsp {
215215
#define IOC_OPAL_GET_GEOMETRY _IOR('p', 238, struct opal_geometry)
216216
#define IOC_OPAL_DISCOVERY _IOW('p', 239, struct opal_discovery)
217217
#define IOC_OPAL_REVERT_LSP _IOW('p', 240, struct opal_revert_lsp)
218+
#define IOC_OPAL_SET_SID_PW _IOW('p', 241, struct opal_new_pw)
218219

219220
#endif /* _UAPI_SED_OPAL_H */

0 commit comments

Comments
 (0)