diff mbox series

cifs: fix DFS mount with cifsacl/modefromsid

Message ID 20200903000239.31507-1-lsahlber@redhat.com (mailing list archive)
State New, archived
Headers show
Series cifs: fix DFS mount with cifsacl/modefromsid | expand

Commit Message

Ronnie Sahlberg Sept. 3, 2020, 12:02 a.m. UTC
RHBZ: 1871246

If during cifs_lookup()/get_inode_info() we encounter a DFS link
and we use the cifsacl or modefromsid mount options we must suppress
any -EREMOTE errors that triggers or else we will not be able to follow
the DFS link and automount the target.

This fixes an issue with modefromsid/cifsacl where these mountoptions woul
break DFS and we would no longer be able to access the share.

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
---
 fs/cifs/inode.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Steve French Sept. 3, 2020, 2:59 a.m. UTC | #1
merged into cifs-2.6.git for-next

On Wed, Sep 2, 2020 at 7:02 PM Ronnie Sahlberg <lsahlber@redhat.com> wrote:
>
> RHBZ: 1871246
>
> If during cifs_lookup()/get_inode_info() we encounter a DFS link
> and we use the cifsacl or modefromsid mount options we must suppress
> any -EREMOTE errors that triggers or else we will not be able to follow
> the DFS link and automount the target.
>
> This fixes an issue with modefromsid/cifsacl where these mountoptions woul
> break DFS and we would no longer be able to access the share.
>
> Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
> ---
>  fs/cifs/inode.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
> index 3989d08396ac..1f75b25e559a 100644
> --- a/fs/cifs/inode.c
> +++ b/fs/cifs/inode.c
> @@ -1017,6 +1017,8 @@ cifs_get_inode_info(struct inode **inode,
>         if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MODE_FROM_SID) {
>                 rc = cifs_acl_to_fattr(cifs_sb, &fattr, *inode, true,
>                                        full_path, fid);
> +               if (rc == -EREMOTE)
> +                       rc = 0;
>                 if (rc) {
>                         cifs_dbg(FYI, "%s: Get mode from SID failed. rc=%d\n",
>                                  __func__, rc);
> @@ -1025,6 +1027,8 @@ cifs_get_inode_info(struct inode **inode,
>         } else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
>                 rc = cifs_acl_to_fattr(cifs_sb, &fattr, *inode, false,
>                                        full_path, fid);
> +               if (rc == -EREMOTE)
> +                       rc = 0;
>                 if (rc) {
>                         cifs_dbg(FYI, "%s: Getting ACL failed with error: %d\n",
>                                  __func__, rc);
> --
> 2.13.6
>
diff mbox series

Patch

diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 3989d08396ac..1f75b25e559a 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -1017,6 +1017,8 @@  cifs_get_inode_info(struct inode **inode,
 	if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MODE_FROM_SID) {
 		rc = cifs_acl_to_fattr(cifs_sb, &fattr, *inode, true,
 				       full_path, fid);
+		if (rc == -EREMOTE)
+			rc = 0;
 		if (rc) {
 			cifs_dbg(FYI, "%s: Get mode from SID failed. rc=%d\n",
 				 __func__, rc);
@@ -1025,6 +1027,8 @@  cifs_get_inode_info(struct inode **inode,
 	} else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
 		rc = cifs_acl_to_fattr(cifs_sb, &fattr, *inode, false,
 				       full_path, fid);
+		if (rc == -EREMOTE)
+			rc = 0;
 		if (rc) {
 			cifs_dbg(FYI, "%s: Getting ACL failed with error: %d\n",
 				 __func__, rc);