Skip to content

Commit 28d4411

Browse files
Olga Kornievskaiaamschuma-ntap
authored andcommitted
pNFS/filelayout: treat GETDEVICEINFO errors as layout failure
When GETDEVICEINFO call fails, return the layout and fall back to MDS. Signed-off-by: Olga Kornievskaia <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent 3e2a036 commit 28d4411

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

fs/nfs/filelayout/filelayout.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,8 @@ fl_pnfs_update_layout(struct inode *ino,
862862

863863
status = filelayout_check_deviceid(lo, fl, gfp_flags);
864864
if (status) {
865+
pnfs_error_mark_layout_for_return(ino, lseg);
866+
pnfs_set_lo_fail(lseg);
865867
pnfs_put_lseg(lseg);
866868
lseg = NULL;
867869
}

fs/nfs/pnfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ pnfs_layout_io_set_failed(struct pnfs_layout_hdr *lo, u32 iomode)
511511

512512
spin_lock(&inode->i_lock);
513513
pnfs_layout_set_fail_bit(lo, pnfs_iomode_to_fail_bit(iomode));
514-
pnfs_mark_matching_lsegs_invalid(lo, &head, &range, 0);
514+
pnfs_mark_matching_lsegs_return(lo, &head, &range, 0);
515515
spin_unlock(&inode->i_lock);
516516
pnfs_free_lseg_list(&head);
517517
dprintk("%s Setting layout IOMODE_%s fail bit\n", __func__,

0 commit comments

Comments
 (0)