git: 5994a93f8604 - stable/13 - CTL: Use atomics for tags in ioctl frontend.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 13 Dec 2022 01:19:30 UTC
The branch stable/13 has been updated by mav:
URL: https://cgit.FreeBSD.org/src/commit/?id=5994a93f86043cc69c0124c1d8b836dbf9347b19
commit 5994a93f86043cc69c0124c1d8b836dbf9347b19
Author: Alexander Motin <mav@FreeBSD.org>
AuthorDate: 2022-12-13 01:15:53 +0000
Commit: Alexander Motin <mav@FreeBSD.org>
CommitDate: 2022-12-13 01:15:53 +0000
CTL: Use atomics for tags in ioctl frontend.
This direct commits is a part of 0acc026dda9e in main.
---
sys/cam/ctl/ctl_frontend_ioctl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sys/cam/ctl/ctl_frontend_ioctl.c b/sys/cam/ctl/ctl_frontend_ioctl.c
index f326100cb013..f53dae694867 100644
--- a/sys/cam/ctl/ctl_frontend_ioctl.c
+++ b/sys/cam/ctl/ctl_frontend_ioctl.c
@@ -75,7 +75,7 @@ struct ctl_fe_ioctl_params {
struct cfi_port {
TAILQ_ENTRY(cfi_port) link;
- uint32_t cur_tag_num;
+ u_int cur_tag_num;
struct cdev * dev;
struct ctl_port port;
};
@@ -634,7 +634,7 @@ ctl_ioctl_io(struct cdev *dev, u_long cmd, caddr_t addr, int flag,
io->io_hdr.flags |= CTL_FLAG_USER_REQ;
if ((io->io_hdr.io_type == CTL_IO_SCSI) &&
(io->scsiio.tag_type != CTL_TAG_UNTAGGED))
- io->scsiio.tag_num = cfi->cur_tag_num++;
+ io->scsiio.tag_num = atomic_fetchadd_int(&cfi->cur_tag_num, 1);
retval = cfi_submit_wait(io);
if (retval == 0)