Skip to content

Commit d78471d

Browse files
bcodding-rhtrondmypd
authored andcommitted
pnfs/blocklayout: set PNFS_LAYOUTRETURN_ON_ERROR
If there's an error doing I/O to block device, and the client resends the I/O to the MDS, the MDS must recall the layout from the client before processing the I/O. Let's preempt that exchange by returning the layout before falling back to the MDS when there's an error. Signed-off-by: Benjamin Coddington <bcodding@redhat.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
1 parent ad6b024 commit d78471d

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎fs/nfs/blocklayout/blocklayout.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,7 @@ static struct pnfs_layoutdriver_type blocklayout_type = {
887887
.name = "LAYOUT_BLOCK_VOLUME",
888888
.owner = THIS_MODULE,
889889
.flags = PNFS_LAYOUTRET_ON_SETATTR |
890+
PNFS_LAYOUTRET_ON_ERROR |
890891
PNFS_READ_WHOLE_PAGE,
891892
.read_pagelist = bl_read_pagelist,
892893
.write_pagelist = bl_write_pagelist,
@@ -910,6 +911,7 @@ static struct pnfs_layoutdriver_type scsilayout_type = {
910911
.name = "LAYOUT_SCSI",
911912
.owner = THIS_MODULE,
912913
.flags = PNFS_LAYOUTRET_ON_SETATTR |
914+
PNFS_LAYOUTRET_ON_ERROR |
913915
PNFS_READ_WHOLE_PAGE,
914916
.read_pagelist = bl_read_pagelist,
915917
.write_pagelist = bl_write_pagelist,

‎fs/nfs/pnfs.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,10 @@ static inline int pnfs_return_layout(struct inode *ino)
524524
struct nfs_inode *nfsi = NFS_I(ino);
525525
struct nfs_server *nfss = NFS_SERVER(ino);
526526

527-
if (pnfs_enabled_sb(nfss) && nfsi->layout)
527+
if (pnfs_enabled_sb(nfss) && nfsi->layout) {
528+
set_bit(NFS_LAYOUT_RETURN_REQUESTED, &nfsi->layout->plh_flags);
528529
return _pnfs_return_layout(ino);
530+
}
529531

530532
return 0;
531533
}

0 commit comments

Comments
 (0)