Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nvme-multipath: set ana_log_size to 0 after free ana_log_buf

Set ana_log_size to 0 when ana_log_buf is freed to make sure
nvme_mpath_init_identify will do the right thing when retrying
after an earlier failure.

Signed-off-by: Hou Tao <houtao1@huawei.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>

authored by

Hou Tao and committed by
Christoph Hellwig
c7c15ae3 793fcab8

+2 -1
+2 -1
drivers/nvme/host/multipath.c
··· 866 866 } 867 867 if (ana_log_size > ctrl->ana_log_size) { 868 868 nvme_mpath_stop(ctrl); 869 - kfree(ctrl->ana_log_buf); 869 + nvme_mpath_uninit(ctrl); 870 870 ctrl->ana_log_buf = kmalloc(ana_log_size, GFP_KERNEL); 871 871 if (!ctrl->ana_log_buf) 872 872 return -ENOMEM; ··· 886 886 { 887 887 kfree(ctrl->ana_log_buf); 888 888 ctrl->ana_log_buf = NULL; 889 + ctrl->ana_log_size = 0; 889 890 }