blocklayoutdriver: Fix reference leak of pnfs_device_node
authorBenjamin Coddington <bcodding@redhat.com>
Tue, 5 Dec 2023 15:05:01 +0000 (10:05 -0500)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Thu, 4 Jan 2024 15:47:56 +0000 (10:47 -0500)
The error path for blocklayout's device lookup is missing a reference drop
for the case where a lookup finds the device, but the device is marked with
NFS_DEVICEID_UNAVAILABLE.

Fixes: b3dce6a2f060 ("pnfs/blocklayout: handle transient devices")
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/blocklayout/blocklayout.c

index 943aeea1eb160fc99bb265c8f9d0a69b77cc4341..1d1d7abc320512ae124eb135f955a2fdfe677efe 100644 (file)
@@ -580,6 +580,8 @@ retry:
                nfs4_delete_deviceid(node->ld, node->nfs_client, id);
                goto retry;
        }
+
+       nfs4_put_deviceid_node(node);
        return ERR_PTR(-ENODEV);
 }