Re: Mapping between EHOSTDOWN to EACCESS in cifs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 28, 2022 at 3:17 AM Bharath SM <bharathsm.hsk@xxxxxxxxx> 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



[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux