mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
libnvdimm/label: Return -ENXIO for no slot in __blk_label_update
[ Upstream commit4c46764733] Forget to set error code when nd_label_alloc_slot failed, and we add it to avoid overwritten error code. Fixes:0ba1c63489("libnvdimm: write blk label set") Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com> Link: https://lore.kernel.org/r/20201205115056.2076523-1-zhangqilong3@huawei.com Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0eecef0fec
commit
0572a4aa74
@@ -999,8 +999,10 @@ static int __blk_label_update(struct nd_region *nd_region,
|
||||
if (is_old_resource(res, old_res_list, old_num_resources))
|
||||
continue; /* carry-over */
|
||||
slot = nd_label_alloc_slot(ndd);
|
||||
if (slot == UINT_MAX)
|
||||
if (slot == UINT_MAX) {
|
||||
rc = -ENXIO;
|
||||
goto abort;
|
||||
}
|
||||
dev_dbg(ndd->dev, "allocated: %d\n", slot);
|
||||
|
||||
nd_label = to_label(ndd, slot);
|
||||
|
||||
Reference in New Issue
Block a user