git: 4068f3b5f899 - main - nda: Don't sleep with non-sleepable lock held

Colin Percival <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a693b32.35db2.4934d9d5__18861.0759492562$1785281360$gmane$org@gitrepo.freebsd.org>
The branch main has been updated by cperciva:

URL: https://cgit.FreeBSD.org/src/commit/?id=4068f3b5f899dd348fd063a5f3c30090eebf9a46

commit 4068f3b5f899dd348fd063a5f3c30090eebf9a46
Author:     Colin Percival <[email protected]>
AuthorDate: 2026-07-14 17:17:25 +0000
Commit:     Colin Percival <[email protected]>
CommitDate: 2026-07-28 23:28:36 +0000

    nda: Don't sleep with non-sleepable lock held
    
    We reach ndaasync with the CAM device lock held, so we must pass
    M_NOWAIT to disk_* rather than M_WAITOK.
    
    Reviewed by:    imp
    Fixes:  628d7a3270b6 ("nda: AC_GETDEV_CHANGED calls media chanaged for sectorsize change")
    MFC after:      1 week
    Sponsored by:   Amazon
    Differential Revision:  https://reviews.freebsd.org/D58230
---
 sys/cam/nvme/nvme_da.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c
index be578bae5da5..ebebe5bbc0a9 100644
--- a/sys/cam/nvme/nvme_da.c
+++ b/sys/cam/nvme/nvme_da.c
@@ -773,9 +773,9 @@ ndaasync(void *callback_arg, uint32_t code, struct cam_path *path, void *arg)
 		 * do nothing.
 		 */
 		if (sectorsize != softc->disk->d_sectorsize)
-			disk_media_changed(softc->disk, M_WAITOK);
+			disk_media_changed(softc->disk, M_NOWAIT);
 		else if (mediasize != softc->disk->d_mediasize)
-			disk_resize(softc->disk, M_WAITOK);
+			disk_resize(softc->disk, M_NOWAIT);
 		break;
 	}
 	case AC_ADVINFO_CHANGED:
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.