Skip to content

Commit

Permalink
nfs41: do not return ENOMEM on LAYOUTUNAVAILABLE
Browse files Browse the repository at this point in the history
A pNFS server may return LAYOUTUNAVAILABLE error on LAYOUTGET for files
which don't have any layout. In this situation pnfs_update_layout
currently returns NULL. As this NULL is converted into ENOMEM, IO
requests fails instead of falling back to MDS.

Do not return ENOMEM on LAYOUTUNAVAILABLE and let client retry through
MDS.

Fixes 8d40b0f. I will suggest to backport this fix to affected
stable branches.

Signed-off-by: Tigran Mkrtchyan <[email protected]>
[trondmy: Use IS_ERR_OR_NULL()]
Fixes: 8d40b0f ("NFS filelayout:call GETDEVICEINFO after...")
Cc: [email protected] # v4.11+
Signed-off-by: Trond Myklebust <[email protected]>
  • Loading branch information
kofemann authored and trondmypd committed Jan 18, 2018
1 parent 1b8d97b commit 7ff4cff
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions fs/nfs/filelayout/filelayout.c
Original file line number Diff line number Diff line change
Expand Up @@ -895,9 +895,7 @@ fl_pnfs_update_layout(struct inode *ino,

lseg = pnfs_update_layout(ino, ctx, pos, count, iomode, strict_iomode,
gfp_flags);
if (!lseg)
lseg = ERR_PTR(-ENOMEM);
if (IS_ERR(lseg))
if (IS_ERR_OR_NULL(lseg))
goto out;

lo = NFS_I(ino)->layout;
Expand Down

0 comments on commit 7ff4cff

Please sign in to comment.