* [PATCH 1/2] blocklayoutdriver: Fix reference leak of pnfs_device_node
@ 2023-12-05 15:05 Benjamin Coddington
2023-12-05 15:05 ` [PATCH 2/2] pnfs/blocklayout: Don't add zero-length pnfs_block_dev Benjamin Coddington
0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Coddington @ 2023-12-05 15:05 UTC (permalink / raw)
To: trond.myklebust, anna; +Cc: linux-nfs
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>
---
fs/nfs/blocklayout/blocklayout.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c
index c1cc9fe93dd4..6be13e0ec170 100644
--- a/fs/nfs/blocklayout/blocklayout.c
+++ b/fs/nfs/blocklayout/blocklayout.c
@@ -580,6 +580,8 @@ bl_find_get_deviceid(struct nfs_server *server,
nfs4_delete_deviceid(node->ld, node->nfs_client, id);
goto retry;
}
+
+ nfs4_put_deviceid_node(node);
return ERR_PTR(-ENODEV);
}
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] pnfs/blocklayout: Don't add zero-length pnfs_block_dev
2023-12-05 15:05 [PATCH 1/2] blocklayoutdriver: Fix reference leak of pnfs_device_node Benjamin Coddington
@ 2023-12-05 15:05 ` Benjamin Coddington
2023-12-06 5:44 ` Christoph Hellwig
0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Coddington @ 2023-12-05 15:05 UTC (permalink / raw)
To: trond.myklebust, anna; +Cc: linux-nfs
We noticed a SCSI device that refused to allow READ CAPACITY when the
device had a PR with exclusive access, registrants only. The result of
this situation is that the blocklayout driver adds a pnfs_block_dev of zero
length which always fails the offset_in_map tests. Instead of continuously
trying to do pNFS for this case, just mark the device as unavailable which
will allow the client to fallback to the MDS for the duration of
PNFS_DEVICE_RETRY_TIMEOUT.
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
---
fs/nfs/blocklayout/dev.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/nfs/blocklayout/dev.c b/fs/nfs/blocklayout/dev.c
index f318a05a80e1..c97ebc42ec0f 100644
--- a/fs/nfs/blocklayout/dev.c
+++ b/fs/nfs/blocklayout/dev.c
@@ -351,6 +351,9 @@ bl_parse_scsi(struct nfs_server *server, struct pnfs_block_dev *d,
d->map = bl_map_simple;
d->pr_key = v->scsi.pr_key;
+ if (d->len == 0)
+ return -ENODEV;
+
pr_info("pNFS: using block device %s (reservation key 0x%llx)\n",
d->bdev_handle->bdev->bd_disk->disk_name, d->pr_key);
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 2/2] pnfs/blocklayout: Don't add zero-length pnfs_block_dev
2023-12-05 15:05 ` [PATCH 2/2] pnfs/blocklayout: Don't add zero-length pnfs_block_dev Benjamin Coddington
@ 2023-12-06 5:44 ` Christoph Hellwig
0 siblings, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2023-12-06 5:44 UTC (permalink / raw)
To: Benjamin Coddington; +Cc: trond.myklebust, anna, linux-nfs
On Tue, Dec 05, 2023 at 10:05:02AM -0500, Benjamin Coddington wrote:
> We noticed a SCSI device that refused to allow READ CAPACITY when the
> device had a PR with exclusive access, registrants only. The result of
> this situation is that the blocklayout driver adds a pnfs_block_dev of zero
> length which always fails the offset_in_map tests. Instead of continuously
> trying to do pNFS for this case, just mark the device as unavailable which
> will allow the client to fallback to the MDS for the duration of
> PNFS_DEVICE_RETRY_TIMEOUT.
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-12-06 5:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-05 15:05 [PATCH 1/2] blocklayoutdriver: Fix reference leak of pnfs_device_node Benjamin Coddington
2023-12-05 15:05 ` [PATCH 2/2] pnfs/blocklayout: Don't add zero-length pnfs_block_dev Benjamin Coddington
2023-12-06 5:44 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox