smb3: add indatalen that can be a non-zero value to calculation of credit charge...
[platform/kernel/linux-rpi.git] / fs / cifs / smb2pdu.c
index ded96b5..3f232c8 100644 (file)
@@ -2973,7 +2973,9 @@ SMB2_ioctl_init(struct cifs_tcon *tcon, struct TCP_Server_Info *server,
         * response size smaller.
         */
        req->MaxOutputResponse = cpu_to_le32(max_response_size);
-       req->sync_hdr.CreditCharge = cpu_to_le16(DIV_ROUND_UP(max_response_size, SMB2_MAX_BUFFER_SIZE));
+       req->sync_hdr.CreditCharge =
+               cpu_to_le16(DIV_ROUND_UP(max(indatalen, max_response_size),
+                                        SMB2_MAX_BUFFER_SIZE));
        if (is_fsctl)
                req->Flags = cpu_to_le32(SMB2_0_IOCTL_IS_FSCTL);
        else