svn commit: r368430 - stable/12/sys/kern
Konstantin Belousov
kib at FreeBSD.org
Tue Dec 8 01:47:59 UTC 2020
Author: kib
Date: Tue Dec 8 01:47:59 2020
New Revision: 368430
URL: https://svnweb.freebsd.org/changeset/base/368430
Log:
MFC r368265:
lio_listio(2): send signal even if number of jobs is zero.
Modified:
stable/12/sys/kern/vfs_aio.c
Directory Properties:
stable/12/ (props changed)
Modified: stable/12/sys/kern/vfs_aio.c
==============================================================================
--- stable/12/sys/kern/vfs_aio.c Tue Dec 8 01:46:44 2020 (r368429)
+++ stable/12/sys/kern/vfs_aio.c Tue Dec 8 01:47:59 2020 (r368430)
@@ -466,7 +466,7 @@ aio_init_aioinfo(struct proc *p)
}
static int
-aio_sendsig(struct proc *p, struct sigevent *sigev, ksiginfo_t *ksi)
+aio_sendsig(struct proc *p, struct sigevent *sigev, ksiginfo_t *ksi, bool ext)
{
struct thread *td;
int error;
@@ -477,7 +477,7 @@ aio_sendsig(struct proc *p, struct sigevent *sigev, ks
if (!KSI_ONQ(ksi)) {
ksiginfo_set_sigev(ksi, sigev);
ksi->ksi_code = SI_ASYNCIO;
- ksi->ksi_flags |= KSI_EXT | KSI_INS;
+ ksi->ksi_flags |= ext ? (KSI_EXT | KSI_INS) : 0;
tdsendsignal(p, td, ksi->ksi_signo, ksi);
}
PROC_UNLOCK(p);
@@ -896,7 +896,7 @@ aio_bio_done_notify(struct proc *userp, struct kaiocb
if (job->uaiocb.aio_sigevent.sigev_notify == SIGEV_SIGNAL ||
job->uaiocb.aio_sigevent.sigev_notify == SIGEV_THREAD_ID)
- aio_sendsig(userp, &job->uaiocb.aio_sigevent, &job->ksi);
+ aio_sendsig(userp, &job->uaiocb.aio_sigevent, &job->ksi, true);
KNOTE_LOCKED(&job->klist, 1);
@@ -909,7 +909,8 @@ aio_bio_done_notify(struct proc *userp, struct kaiocb
== LIOJ_SIGNAL &&
(lj->lioj_signal.sigev_notify == SIGEV_SIGNAL ||
lj->lioj_signal.sigev_notify == SIGEV_THREAD_ID)) {
- aio_sendsig(userp, &lj->lioj_signal, &lj->lioj_ksi);
+ aio_sendsig(userp, &lj->lioj_signal, &lj->lioj_ksi,
+ true);
lj->lioj_flags |= LIOJ_SIGNAL_POSTED;
}
}
@@ -2232,7 +2233,8 @@ kern_lio_listio(struct thread *td, int mode, struct ai
LIOJ_SIGNAL_POSTED)) == LIOJ_SIGNAL &&
(lj->lioj_signal.sigev_notify == SIGEV_SIGNAL ||
lj->lioj_signal.sigev_notify == SIGEV_THREAD_ID)) {
- aio_sendsig(p, &lj->lioj_signal, &lj->lioj_ksi);
+ aio_sendsig(p, &lj->lioj_signal, &lj->lioj_ksi,
+ lj->lioj_count != 1);
lj->lioj_flags |= LIOJ_SIGNAL_POSTED;
}
}
More information about the svn-src-all
mailing list