Merge tag 'block-7.0-20260227' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux

Pull block fixes from Jens Axboe:
 "Two sets of fixes, one for drbd, and one for the zoned loop driver"

* tag 'block-7.0-20260227' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux:
  zloop: check for spurious options passed to remove
  zloop: advertise a volatile write cache
  drbd: fix null-pointer dereference on local read error
  drbd: Replace deprecated strcpy with strscpy
  drbd: fix "LOGIC BUG" in drbd_al_begin_io_nonblock()
This commit is contained in:
Linus Torvalds
2026-02-27 10:42:02 -08:00
6 changed files with 64 additions and 46 deletions

View File

@@ -542,6 +542,21 @@ out:
zloop_put_cmd(cmd);
}
/*
* Sync the entire FS containing the zone files instead of walking all files.
*/
static int zloop_flush(struct zloop_device *zlo)
{
struct super_block *sb = file_inode(zlo->data_dir)->i_sb;
int ret;
down_read(&sb->s_umount);
ret = sync_filesystem(sb);
up_read(&sb->s_umount);
return ret;
}
static void zloop_handle_cmd(struct zloop_cmd *cmd)
{
struct request *rq = blk_mq_rq_from_pdu(cmd);
@@ -562,11 +577,7 @@ static void zloop_handle_cmd(struct zloop_cmd *cmd)
zloop_rw(cmd);
return;
case REQ_OP_FLUSH:
/*
* Sync the entire FS containing the zone files instead of
* walking all files
*/
cmd->ret = sync_filesystem(file_inode(zlo->data_dir)->i_sb);
cmd->ret = zloop_flush(zlo);
break;
case REQ_OP_ZONE_RESET:
cmd->ret = zloop_reset_zone(zlo, rq_zone_no(rq));
@@ -981,7 +992,8 @@ static int zloop_ctl_add(struct zloop_options *opts)
struct queue_limits lim = {
.max_hw_sectors = SZ_1M >> SECTOR_SHIFT,
.chunk_sectors = opts->zone_size,
.features = BLK_FEAT_ZONED,
.features = BLK_FEAT_ZONED | BLK_FEAT_WRITE_CACHE,
};
unsigned int nr_zones, i, j;
struct zloop_device *zlo;
@@ -1162,7 +1174,12 @@ static int zloop_ctl_remove(struct zloop_options *opts)
int ret;
if (!(opts->mask & ZLOOP_OPT_ID)) {
pr_err("No ID specified\n");
pr_err("No ID specified for remove\n");
return -EINVAL;
}
if (opts->mask & ~ZLOOP_OPT_ID) {
pr_err("Invalid option specified for remove\n");
return -EINVAL;
}