Skip to content

Commit d76c769

Browse files
bcodding-rhamschuma-ntap
authored andcommitted
pnfs/blocklayout: Don't add zero-length pnfs_block_dev
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> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
1 parent 1530827 commit d76c769

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/nfs/blocklayout/dev.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,9 @@ bl_parse_scsi(struct nfs_server *server, struct pnfs_block_dev *d,
351351
d->map = bl_map_simple;
352352
d->pr_key = v->scsi.pr_key;
353353

354+
if (d->len == 0)
355+
return -ENODEV;
356+
354357
pr_info("pNFS: using block device %s (reservation key 0x%llx)\n",
355358
d->bdev_handle->bdev->bd_disk->disk_name, d->pr_key);
356359

0 commit comments

Comments
 (0)