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



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux