]> Git Repo - linux.git/commitdiff
libnvdimm/label: Return -ENXIO for no slot in __blk_label_update
authorZhang Qilong <[email protected]>
Sat, 5 Dec 2020 11:50:56 +0000 (19:50 +0800)
committerDan Williams <[email protected]>
Thu, 17 Dec 2020 00:53:00 +0000 (16:53 -0800)
Forget to set error code when nd_label_alloc_slot failed, and we
add it to avoid overwritten error code.

Fixes: 0ba1c634892b ("libnvdimm: write blk label set")
Signed-off-by: Zhang Qilong <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dan Williams <[email protected]>
drivers/nvdimm/label.c

index 6f2be7a34598c4d98e7546881a48c60fa7b39172..9251441fd8a3522430cecbdff983334a0fe59cf1 100644 (file)
@@ -1008,8 +1008,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);
This page took 0.063274 seconds and 4 git commands to generate.