NFS client fixes for Linux 4.15-rc2

Bugfixes:
 - NFSv4: Ensure gcc 4.4.4 can compile initialiser for "invalid_stateid"
 - SUNRPC: Allow connect to return EHOSTUNREACH
 - SUNRPC: Handle ENETDOWN errors
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEnZ5MQTpR7cLU7KEp18tUv7ClQOsFAlohwp4ACgkQ18tUv7Cl
 QOtq1A//RPOxJBPQsImfkVTiVzxZbS8k2/obJSZjPYoNozmywEJs9dnFYJVCFUGp
 l9AvRd/SjXOVjGovk6ZhDCY3xA2eP1XfOLiVg7EhpczPVCRNJ34BUT7hWyxnTLSz
 MKc1qLLfVaSjsLioO6YmdCPjiGC0KegrBKNlRlIbI+OjCq5aNJpz73Fb4mFgCp5M
 taERunf7X29WHxAVn0c3mhIHN7tpCi9SgfbMURBEKLNrzj7RxnRY07dT1S9Mg/Yg
 4FWU9FIpAyk9C9we/LR9jUywZQ3GGJFFFTOo8RfyMB/LR9RACSXnbHjhI1nUEQTb
 R/NpBxlpvxEOapHdmw32jwj1fkY/WYlUiJekQhjEekp/HkFNdctQL8PjrhG6lIW7
 eBfFqZ2RUhYF1OQ8k4o0pR60O2scH3/D7tZwpgnJMFSpQSMnPnU8K3gvn/B5Mi4f
 UPDHtfj3GlWCIIJq1RIqKN4mt4tPktatnTCLIzDmqNbwqISwxow1lxmSesNejULo
 MryXLLl5M3XegjokXs0d0hadoywswHRTAxXxQEZav0dKMcHq4F0NirVw+VOIyNCB
 CztIVFI5Czzo4h4x99lgN26bNTysGMvse2qiPkVVr0CZt2leyrZyTl9khvDe3C0t
 ijyq882b4LqibuQtnI3l/Pynrrowfp7fqYx7SO62VJjraBVYUzE=
 =eQyi
 -----END PGP SIGNATURE-----

Merge tag 'nfs-for-4.15-2' of git://git.linux-nfs.org/projects/anna/linux-nfs

Pull NFS client fixes from Anna Schumaker:
 "These patches fix a problem with compiling using an old version of
  gcc, and also fix up error handling in the SUNRPC layer.

   - NFSv4: Ensure gcc 4.4.4 can compile initialiser for
     "invalid_stateid"

   - SUNRPC: Allow connect to return EHOSTUNREACH

   - SUNRPC: Handle ENETDOWN errors"

* tag 'nfs-for-4.15-2' of git://git.linux-nfs.org/projects/anna/linux-nfs:
  SUNRPC: Handle ENETDOWN errors
  SUNRPC: Allow connect to return EHOSTUNREACH
  NFSv4: Ensure gcc 4.4.4 can compile initialiser for "invalid_stateid"
This commit is contained in:
Linus Torvalds 2017-12-01 20:04:20 -05:00
commit 2db767d988
3 changed files with 9 additions and 2 deletions

View File

@ -71,8 +71,8 @@ const nfs4_stateid zero_stateid = {
}; };
const nfs4_stateid invalid_stateid = { const nfs4_stateid invalid_stateid = {
{ {
.seqid = cpu_to_be32(0xffffffffU), /* Funky initialiser keeps older gcc versions happy */
.other = { 0 }, .data = { 0xff, 0xff, 0xff, 0xff, 0 },
}, },
.type = NFS4_INVALID_STATEID_TYPE, .type = NFS4_INVALID_STATEID_TYPE,
}; };

View File

@ -1841,6 +1841,7 @@ call_bind_status(struct rpc_task *task)
case -ECONNABORTED: case -ECONNABORTED:
case -ENOTCONN: case -ENOTCONN:
case -EHOSTDOWN: case -EHOSTDOWN:
case -ENETDOWN:
case -EHOSTUNREACH: case -EHOSTUNREACH:
case -ENETUNREACH: case -ENETUNREACH:
case -ENOBUFS: case -ENOBUFS:
@ -1917,6 +1918,7 @@ call_connect_status(struct rpc_task *task)
/* fall through */ /* fall through */
case -ECONNRESET: case -ECONNRESET:
case -ECONNABORTED: case -ECONNABORTED:
case -ENETDOWN:
case -ENETUNREACH: case -ENETUNREACH:
case -EHOSTUNREACH: case -EHOSTUNREACH:
case -EADDRINUSE: case -EADDRINUSE:
@ -2022,6 +2024,7 @@ call_transmit_status(struct rpc_task *task)
*/ */
case -ECONNREFUSED: case -ECONNREFUSED:
case -EHOSTDOWN: case -EHOSTDOWN:
case -ENETDOWN:
case -EHOSTUNREACH: case -EHOSTUNREACH:
case -ENETUNREACH: case -ENETUNREACH:
case -EPERM: case -EPERM:
@ -2071,6 +2074,7 @@ call_bc_transmit(struct rpc_task *task)
switch (task->tk_status) { switch (task->tk_status) {
case 0: case 0:
/* Success */ /* Success */
case -ENETDOWN:
case -EHOSTDOWN: case -EHOSTDOWN:
case -EHOSTUNREACH: case -EHOSTUNREACH:
case -ENETUNREACH: case -ENETUNREACH:
@ -2139,6 +2143,7 @@ call_status(struct rpc_task *task)
task->tk_status = 0; task->tk_status = 0;
switch(status) { switch(status) {
case -EHOSTDOWN: case -EHOSTDOWN:
case -ENETDOWN:
case -EHOSTUNREACH: case -EHOSTUNREACH:
case -ENETUNREACH: case -ENETUNREACH:
case -EPERM: case -EPERM:

View File

@ -2440,7 +2440,9 @@ static void xs_tcp_setup_socket(struct work_struct *work)
*/ */
case -ECONNREFUSED: case -ECONNREFUSED:
case -ECONNRESET: case -ECONNRESET:
case -ENETDOWN:
case -ENETUNREACH: case -ENETUNREACH:
case -EHOSTUNREACH:
case -EADDRINUSE: case -EADDRINUSE:
case -ENOBUFS: case -ENOBUFS:
/* /*