Fix regression which breaks DFS mounting
authorSachin Prabhu <sprabhu@redhat.com>
Thu, 26 Jan 2017 13:28:49 +0000 (14:28 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 20 Jun 2017 12:04:10 +0000 (14:04 +0200)
commit d171356ff11ab1825e456dfb979755e01b3c54a1 upstream.

Patch a6b5058 results in -EREMOTE returned by is_path_accessible() in
cifs_mount() to be ignored which breaks DFS mounting.

Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
fs/cifs/connect.c

index cbdc5b02e6e72e89ccbe6d9164883c23ad3c01fb..417ce0a497f4cabb3e1bcb179c5bb8db646cfa26 100644 (file)
@@ -3622,15 +3622,16 @@ remote_path_check:
                        kfree(full_path);
                        goto mount_fail_check;
                }
-
-               rc = cifs_are_all_path_components_accessible(server,
-                                                            xid, tcon, cifs_sb,
-                                                            full_path);
-               if (rc != 0) {
-                       cifs_dbg(VFS, "cannot query dirs between root and final path, "
-                                "enabling CIFS_MOUNT_USE_PREFIX_PATH\n");
-                       cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_USE_PREFIX_PATH;
-                       rc = 0;
+               if (rc != -EREMOTE) {
+                       rc = cifs_are_all_path_components_accessible(server,
+                                                                    xid, tcon, cifs_sb,
+                                                                    full_path);
+                       if (rc != 0) {
+                               cifs_dbg(VFS, "cannot query dirs between root and final path, "
+                                        "enabling CIFS_MOUNT_USE_PREFIX_PATH\n");
+                               cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_USE_PREFIX_PATH;
+                               rc = 0;
+                       }
                }
                kfree(full_path);
        }