linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Mapping between EHOSTDOWN to EACCESS in cifs
@ 2022-01-27  9:54 Bharath SM
  2022-02-02 22:24 ` ronnie sahlberg
  0 siblings, 1 reply; 2+ messages in thread
From: Bharath SM @ 2022-01-27  9:54 UTC (permalink / raw)
  To: linux-cifs, linux-fsdevel

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.?

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.?

Thanks,
Bharath

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Mapping between EHOSTDOWN to EACCESS in cifs
  2022-01-27  9:54 Mapping between EHOSTDOWN to EACCESS in cifs Bharath SM
@ 2022-02-02 22:24 ` ronnie sahlberg
  0 siblings, 0 replies; 2+ messages in thread
From: ronnie sahlberg @ 2022-02-02 22:24 UTC (permalink / raw)
  To: Bharath SM; +Cc: linux-cifs, linux-fsdevel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-02 22:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-27  9:54 Mapping between EHOSTDOWN to EACCESS in cifs Bharath SM
2022-02-02 22:24 ` ronnie sahlberg

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).