提交 7ff4cff6 编写于 作者: T Tigran Mkrtchyan 提交者: Trond Myklebust

nfs41: do not return ENOMEM on LAYOUTUNAVAILABLE

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 8d40b0f1. I will suggest to backport this fix to affected
stable branches.
Signed-off-by: NTigran Mkrtchyan <tigran.mkrtchyan@desy.de>
[trondmy: Use IS_ERR_OR_NULL()]
Fixes: 8d40b0f1 ("NFS filelayout:call GETDEVICEINFO after...")
Cc: stable@vger.kernel.org # v4.11+
Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
上级 1b8d97b0
...@@ -895,9 +895,7 @@ fl_pnfs_update_layout(struct inode *ino, ...@@ -895,9 +895,7 @@ fl_pnfs_update_layout(struct inode *ino,
lseg = pnfs_update_layout(ino, ctx, pos, count, iomode, strict_iomode, lseg = pnfs_update_layout(ino, ctx, pos, count, iomode, strict_iomode,
gfp_flags); gfp_flags);
if (!lseg) if (IS_ERR_OR_NULL(lseg))
lseg = ERR_PTR(-ENOMEM);
if (IS_ERR(lseg))
goto out; goto out;
lo = NFS_I(ino)->layout; lo = NFS_I(ino)->layout;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册