cifs: change ERRnomem error mapping from ENOMEM to EREMOTEIO
authorJeff Layton <jlayton@redhat.com>
Thu, 7 Nov 2013 20:02:35 +0000 (15:02 -0500)
committerSteve French <smfrench@gmail.com>
Mon, 11 Nov 2013 22:33:25 +0000 (16:33 -0600)
Sometimes, the server will report an error that basically indicates
that it's running out of resources. These include these under SMB1:

NT_STATUS_NO_MEMORY
NT_STATUS_SECTION_TOO_BIG
NT_STATUS_TOO_MANY_PAGING_FILES

...and this one under SMB2:

STATUS_NO_MEMORY

Currently, this gets mapped to ENOMEM by the client, but that's
confusing as an ENOMEM error is typically an indicator that the
client is out of memory.

Change these errors to instead map to EREMOTEIO to indicate that
the problem is actually server-side and not on the client.

Reported-by: "ISHIKAWA,chiaki" <ishikawa@yk.rim.or.jp>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
fs/cifs/netmisc.c
fs/cifs/smb2maperror.c

index 651a5279607b968a255a528e5411e4f4b39ca438..049884552e76385091513111576bdf11703945aa 100644 (file)
@@ -51,7 +51,7 @@ static const struct smb_to_posix_error mapping_table_ERRDOS[] = {
        {ERRnoaccess, -EACCES},
        {ERRbadfid, -EBADF},
        {ERRbadmcb, -EIO},
-       {ERRnomem, -ENOMEM},
+       {ERRnomem, -EREMOTEIO},
        {ERRbadmem, -EFAULT},
        {ERRbadenv, -EFAULT},
        {ERRbadformat, -EINVAL},
index 7c2f45c06fc219357fa15d5b46f8aa8ac5449aba..94bd4fbb13d3d28283ec4d705086d784d0f70eaf 100644 (file)
@@ -306,7 +306,7 @@ static const struct status_to_posix_error smb2_error_map_table[] = {
        {STATUS_NONEXISTENT_SECTOR, -EIO, "STATUS_NONEXISTENT_SECTOR"},
        {STATUS_MORE_PROCESSING_REQUIRED, -EIO,
        "STATUS_MORE_PROCESSING_REQUIRED"},
-       {STATUS_NO_MEMORY, -ENOMEM, "STATUS_NO_MEMORY"},
+       {STATUS_NO_MEMORY, -EREMOTEIO, "STATUS_NO_MEMORY"},
        {STATUS_CONFLICTING_ADDRESSES, -EADDRINUSE,
        "STATUS_CONFLICTING_ADDRESSES"},
        {STATUS_NOT_MAPPED_VIEW, -EIO, "STATUS_NOT_MAPPED_VIEW"},