Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: "ISHIKAWA,chiaki" <ishikawa-FORCTJUUkgPbmG5+kqVDhQ@public.gmane.org>
To: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: A suggestion for error value, and question regarding EINTR for user-space system calls.
Date: Fri, 08 Nov 2013 00:20:38 +0900	[thread overview]
Message-ID: <527BAFC6.5010600@yk.rim.or.jp> (raw)

I am a newcomer to linux-cifs.

Thank you for offering the great software package, which has improved
greatly over the last few years.

I have a suggestion and a question.

1. Suggestion: Change the return value ENOMEM -> EREMOTEIO for an error
scenario.

There was a discussion to changeerror code returned to user-level system
calls when the remote server providing CIFS-share
failing due to the allocation failure of non-paged resources, especially
Windows 7:

Currently the returned errno value is ENOMEM.

See the discussion here, for example;
http://thread.gmane.org/gmane.linux.kernel.cifs/4281

especially the following one:
http://article.gmane.org/gmane.linux.kernel.cifs/4303

The suggestion there was to change this value to EREMOTEIO.

I wonder what came out of the discussion.
CIFS client in linux kernel still seems to return ENOMEM instead of
EREMOTEIO.

I will go for EREMOTEIO change any time.

ENOMEM suggests to me that there is a LOCAL resource shortage,
and it is difficult to gauge that system is telling us that there is
something missing in the remote end.

EREMOTEIO is much better in this regard, I think.

I wasted looking at local log files and dmesg output before
I got wiser and checked the remote Windows 7 system log when I saw
"Cannot allocate memory." message.

By the way, EREMOTEIO is not defined in POSIX.
Under linux it is defined as
#define	EREMOTEIO	121	/* Remote I/O error */

(at least in my copy of
Linux vm-debian-amd64 3.10-3-amd64 #1 SMP Debian 3.10.11-1 (2013-09-10)
x86_64 GNU/Linux )

Since linux-cifs is for linux obviously, I think it is OK to return
EREMOTEIO without bothering the conformance to POSIX here.

Decreasing the chance of user confusion when they see the message of
"Cannot allocate memory" printed as the error message when mount fails
due to ENOMEM being returned for this error
on the remote side of the connection is more important IMHO.

2. Question:  Can read()/write()/close() against CIFS-share return EINTR
in errno?

This may involve a few assumptions regarding the
 - mount parameter: soft (default) vs hard
 - program's signal setting

Assuming that mount parameter is soft (default),
can read/write/close end up returning EINTR in errno?

I have seen EHOSTDOWN stored in errno by failing read() when I simulated
network error by disabling network card of a VM in which a copy of
linux runs and when it was mounting a host Windows7 CIFS-share.
(close() returned -1, too. But I forgot to record the errno value then.)

My question is whether linux CIFS client can return EINTR  in errno by
interrupted read/write/close, and if so, I think I should retry
these system calls up to a certain amount of time (so that the failure
will not block the program forever...)
Currently, there is no clear documentation about the error code returned
to the user-level system calls, and so I am asking the mailing list.



Thank you, whoever those would be, again for the improved CIFS
package. After I gave up on using CIFS under linux due to its very
slow speed against office server, I was quite pleasantly surprised
with the transfer speed this week when I tried it for the first time
in a few years. (If only my windows7 server didn't hiccup due to the
well known issue.)


TIA

             reply	other threads:[~2013-11-07 15:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-07 15:20 ISHIKAWA,chiaki [this message]
     [not found] ` <527BAFC6.5010600-FORCTJUUkgPbmG5+kqVDhQ@public.gmane.org>
2013-11-07 16:03   ` A suggestion for error value, and question regarding EINTR for user-space system calls Jeff Layton
     [not found]     ` <20131107110353.6d203196-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2013-11-07 16:12       ` Steve French
     [not found]         ` <CAH2r5mtuM6e7BpHk06sM9rzOxfcRgdkmw0vuQhJfYsrJkfrEdA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-11-07 17:11           ` ISHIKAWA,chiaki
     [not found]             ` <527BC9C9.5080502-FORCTJUUkgPbmG5+kqVDhQ@public.gmane.org>
2013-11-08 17:09               ` ISHIKAWA,chiaki
     [not found]                 ` <527D1ABD.3080404-FORCTJUUkgPbmG5+kqVDhQ@public.gmane.org>
2013-11-08 17:41                   ` Hung CIFS driver ISHIKAWA,chiaki
     [not found]                     ` <527D2255.1070709-FORCTJUUkgPbmG5+kqVDhQ@public.gmane.org>
2013-11-09 11:58                       ` Jeff Layton
     [not found]                         ` <20131109065826.481ff52c-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2013-11-10  4:40                           ` ISHIKAWA,chiaki
     [not found]                             ` <527F0E21.603-FORCTJUUkgPbmG5+kqVDhQ@public.gmane.org>
2013-11-10  5:49                               ` ISHIKAWA,chiaki
     [not found]                                 ` <527F1E5A.9090900-FORCTJUUkgPbmG5+kqVDhQ@public.gmane.org>
2013-11-10 12:12                                   ` ISHIKAWA,chiaki
2013-11-10 12:04                               ` Jeff Layton
     [not found]                                 ` <20131110070412.0c685682-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2013-11-10 12:29                                   ` ISHIKAWA,chiaki
     [not found]                                     ` <527F7C46.4040105-FORCTJUUkgPbmG5+kqVDhQ@public.gmane.org>
2013-11-10 12:38                                       ` ISHIKAWA,chiaki
     [not found]                                         ` <527F7E54.5080905-FORCTJUUkgPbmG5+kqVDhQ@public.gmane.org>
2013-11-10 14:06                                           ` ISHIKAWA,chiaki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=527BAFC6.5010600@yk.rim.or.jp \
    --to=ishikawa-forctjuukgpbmg5+kqvdhq@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox