Skip to content

Commit 5631319

Browse files
committed
Linux 6.10 compat: Fix zvol NULL pointer deference
zvol_alloc_non_blk_mq()->blk_queue_set_write_cache() needs the disk queue setup to prevent a NULL pointer deference. Signed-off-by: Tony Hutter <[email protected]>
1 parent f2f4ada commit 5631319

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

module/os/linux/zfs/zvol_os.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,13 +1261,14 @@ zvol_alloc_non_blk_mq(struct zvol_state_os *zso, zvol_queue_limits_t *limits)
12611261
return (1);
12621262
}
12631263

1264+
zso->zvo_disk = disk;
1265+
zso->zvo_disk->minors = ZVOL_MINORS;
1266+
zso->zvo_queue = zso->zvo_disk->queue;
1267+
12641268
#ifndef HAVE_BLKDEV_QUEUE_LIMITS_FEATURES
12651269
blk_queue_set_write_cache(zso->zvo_queue, B_TRUE);
12661270
#endif
12671271

1268-
zso->zvo_disk = disk;
1269-
zso->zvo_disk->minors = ZVOL_MINORS;
1270-
zso->zvo_queue = zso->zvo_disk->queue;
12711272
#else
12721273
zso->zvo_queue = blk_alloc_queue(NUMA_NO_NODE);
12731274
if (zso->zvo_queue == NULL)

0 commit comments

Comments
 (0)