[CIFS] Fix cifs reconnection flags
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / fs / cifs / cifsfs.c
index 76919c25acc7927e6512b663c1a87658c42d2399..903bbd6449d1084e3e5e8ad469ab7ad9ccf669a3 100644 (file)
@@ -275,9 +275,12 @@ static int cifs_permission(struct inode *inode, int mask)
 
        cifs_sb = CIFS_SB(inode->i_sb);
 
-       if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM)
-               return 0;
-       else /* file mode might have been restricted at mount time
+       if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM) {
+               if ((mask & MAY_EXEC) && !execute_ok(inode))
+                       return -EACCES;
+               else
+                       return 0;
+       } else /* file mode might have been restricted at mount time
                on the client (above and beyond ACL on servers) for
                servers which do not support setting and viewing mode bits,
                so allowing client to check permissions is useful */
@@ -801,6 +804,7 @@ const struct file_operations cifs_dir_ops = {
        .dir_notify = cifs_dir_notify,
 #endif /* CONFIG_CIFS_EXPERIMENTAL */
        .unlocked_ioctl  = cifs_ioctl,
+       .llseek = generic_file_llseek,
 };
 
 static void
@@ -1009,7 +1013,7 @@ static int cifs_oplock_thread(void *dummyarg)
                                not bother sending an oplock release if session
                                to server still is disconnected since oplock
                                already released by the server in that case */
-                       if (pTcon->tidStatus != CifsNeedReconnect) {
+                       if (!pTcon->need_reconnect) {
                                rc = CIFSSMBLock(0, pTcon, netfid,
                                                0 /* len */ , 0 /* offset */, 0,
                                                0, LOCKING_ANDX_OPLOCK_RELEASE,