summaryrefslogtreecommitdiffstats
path: root/fs/nfs/blocklayout/dev.c
diff options
context:
space:
mode:
authorBenjamin Coddington <bcodding@redhat.com>2017-12-08 12:52:59 -0500
committerTrond Myklebust <trond.myklebust@primarydata.com>2018-01-14 23:06:29 -0500
commitb3dce6a2f0601be9b6781b394fdf6ceb63009a44 (patch)
tree29a6db7a31e900e301a4cb26a7cb0b1c557c5aa1 /fs/nfs/blocklayout/dev.c
parentd78471d32bb60837930026e11828af596fb4bdac (diff)
downloadlinux-b3dce6a2f0601be9b6781b394fdf6ceb63009a44.tar.gz
linux-b3dce6a2f0601be9b6781b394fdf6ceb63009a44.tar.bz2
linux-b3dce6a2f0601be9b6781b394fdf6ceb63009a44.zip
pnfs/blocklayout: handle transient devices
PNFS block/SCSI layouts should gracefully handle cases where block devices are not available when a layout is retrieved, or the block devices are removed while the client holds a layout. While setting up a layout segment, keep a record of an unavailable or un-parsable block device in cache with a flag so that subsequent layouts do not spam the server with GETDEVINFO. We can reuse the current NFS_DEVICEID_UNAVAILABLE handling with one variation: instead of reusing the device, we will discard it and send a fresh GETDEVINFO after the timeout, since the lookup and validation of the device occurs within the GETDEVINFO response handling. A lookup of a layout segment that references an unavailable device will return a segment with the NFS_LSEG_UNAVAILABLE flag set. This will allow the pgio layer to mark the layout with the appropriate fail bit, which forces subsequent IO to the MDS, and prevents spamming the server with LAYOUTGET, LAYOUTRETURN. Finally, when IO to a block device fails, look up the block device(s) referenced by the pgio header, and mark them as unavailable. Signed-off-by: Benjamin Coddington <bcodding@redhat.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/blocklayout/dev.c')
-rw-r--r--fs/nfs/blocklayout/dev.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/nfs/blocklayout/dev.c b/fs/nfs/blocklayout/dev.c
index 95f74bd2c067..a7efd83779d2 100644
--- a/fs/nfs/blocklayout/dev.c
+++ b/fs/nfs/blocklayout/dev.c
@@ -533,14 +533,11 @@ bl_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
goto out_free_volumes;
ret = bl_parse_deviceid(server, top, volumes, nr_volumes - 1, gfp_mask);
- if (ret) {
- bl_free_device(top);
- kfree(top);
- goto out_free_volumes;
- }
node = &top->node;
nfs4_init_deviceid_node(node, server, &pdev->dev_id);
+ if (ret)
+ nfs4_mark_deviceid_unavailable(node);
out_free_volumes:
kfree(volumes);