linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: ronnie sahlberg <ronniesahlberg@gmail.com>
To: Bharath SM <bharathsm.hsk@gmail.com>
Cc: linux-cifs <linux-cifs@vger.kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: Mapping between EHOSTDOWN to EACCESS in cifs
Date: Thu, 3 Feb 2022 08:24:15 +1000	[thread overview]
Message-ID: <CAN05THRxUMdURpyi1XCX_o4f8QZB2ssTZyS-TPKfsgLu7-2AjA@mail.gmail.com> (raw)
In-Reply-To: <CAGypqWxPnYx1PwhCQcyb7LLAB0JPsK2kmPWcrmx98Cs0As1y7A@mail.gmail.com>

On Fri, Jan 28, 2022 at 3:17 AM Bharath SM <bharathsm.hsk@gmail.com> wrote:
>
> Hi Team,
>
> I came across the following behavior case of CIFS session setup failures.
> CIFS returns "EHOSTDOWN" to userspace when it fails to reconnect while
> doing session setup because of change in password or change in ACL's.
> Should we instead replace it with EACCESS for these special cases.?

Possibly but not sure.

When it comes to changed password, or situations where the user
account no longer even exists
(we can not distinguish between these two conditions from the server
status code)
I think EHOSTDOWN is valid to return as SessionSetup failures are
about connectivity and/or authentication failures and not
about access control.

I.e. it is not access control that caused the reconnect to fail. It is
authentication that failed.

Thus I think:
EHOSTDOWN as "can not connect to the server"
EACCESS as "am not allowed to access the share"

>
> I would also like to understand the implications of mapping EHOSTDOWN
> to EACCESS at the user space for the above mentioned case and how it
> is done in other file systems.?
> Can you please share your comments/thoughts on this.?

I don't think userspace should do this kind of remapping.
Inability to connect to the server and not being allowed to access a
share should
 be treated as two distinct failures in the application, if not for
allowing the application
to decide how to recover at least to let it log an errno value that
could hint about the issue.

>
> Thanks,
> Bharath

      reply	other threads:[~2022-02-02 22:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27  9:54 Mapping between EHOSTDOWN to EACCESS in cifs Bharath SM
2022-02-02 22:24 ` ronnie sahlberg [this message]

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=CAN05THRxUMdURpyi1XCX_o4f8QZB2ssTZyS-TPKfsgLu7-2AjA@mail.gmail.com \
    --to=ronniesahlberg@gmail.com \
    --cc=bharathsm.hsk@gmail.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).