nfs41: do not return ENOMEM on LAYOUTUNAVAILABLE
authorTigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Tue, 16 Jan 2018 21:38:50 +0000 (22:38 +0100)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Thu, 18 Jan 2018 17:51:31 +0000 (12:51 -0500)
commit7ff4cff637aa0bd2abbd81f53b2a6206c50afd95
tree0f37c131655231d9e1d7c933771579730efb70dd
parent1b8d97b0a837beaf48a8449955b52c650a7114b4
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 8d40b0f14846f. I will suggest to backport this fix to affected
stable branches.

Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
[trondmy: Use IS_ERR_OR_NULL()]
Fixes: 8d40b0f14846 ("NFS filelayout:call GETDEVICEINFO after...")
Cc: stable@vger.kernel.org # v4.11+
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/filelayout/filelayout.c