Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
[firefly-linux-kernel-4.4.55.git] / fs / cifs / inode.c
index c23bdec805c557748d3f205704638bd889c2afa7..197cb503d5280b4a3f4425d531f444ef9b7f1baf 100644 (file)
@@ -960,11 +960,18 @@ struct inode *cifs_root_iget(struct super_block *sb)
        struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb);
 
        xid = get_xid();
-       if (tcon->unix_ext)
+       if (tcon->unix_ext) {
                rc = cifs_get_inode_info_unix(&inode, "", sb, xid);
-       else
-               rc = cifs_get_inode_info(&inode, "", NULL, sb, xid, NULL);
+               /* some servers mistakenly claim POSIX support */
+               if (rc != -EOPNOTSUPP)
+                       goto iget_no_retry;
+               cifs_dbg(VFS, "server does not support POSIX extensions");
+               tcon->unix_ext = false;
+       }
+
+       rc = cifs_get_inode_info(&inode, "", NULL, sb, xid, NULL);
 
+iget_no_retry:
        if (!inode) {
                inode = ERR_PTR(rc);
                goto out;