From 9270b00ffa271529921e9456bb77a40003c147fd Mon Sep 17 00:00:00 2001 From: zlxzfg <1528343280@qq.com> Date: Mon, 27 May 2024 17:28:16 +0800 Subject: [PATCH] tcmur_cmd_handler: To fix the issue on a CentOS 7.9 client where the tcmu-runner ver=1.5.4 service faild after using mkfs.xfs to format a LUN device --- tcmur_cmd_handler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcmur_cmd_handler.c b/tcmur_cmd_handler.c index 01d6a109..dfde92ef 100644 --- a/tcmur_cmd_handler.c +++ b/tcmur_cmd_handler.c @@ -685,7 +685,7 @@ static int handle_unmap_in_writesame(struct tcmu_device *dev, int ret; /* If not aligned then falls back to the writesame without unmap */ - if (lba % align || nlbas % align) { + if (align == 0 || lba % align || nlbas % align) { tcmu_dev_dbg(dev, "Start lba: %"PRIu64" or nlbas: %"PRIu64" not aligned to %"PRIu32"\n", lba, nlbas, align);