get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.2/patches/833231/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 833231,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/833231/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20171102070312.18903-14-lsahlber@redhat.com/",
    "project": {
        "id": 12,
        "url": "http://patchwork.ozlabs.org/api/1.2/projects/12/?format=api",
        "name": "Linux CIFS Client",
        "link_name": "linux-cifs-client",
        "list_id": "linux-cifs.vger.kernel.org",
        "list_email": "linux-cifs@vger.kernel.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20171102070312.18903-14-lsahlber@redhat.com>",
    "list_archive_url": null,
    "date": "2017-11-02T07:03:06",
    "name": "[13/19] cifs: remove rfc1002 header from smb2 read/write requests",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "02b1a5c8ace0f45c3c2e41a479b6b2547a929583",
    "submitter": {
        "id": 72324,
        "url": "http://patchwork.ozlabs.org/api/1.2/people/72324/?format=api",
        "name": "Ronnie Sahlberg",
        "email": "lsahlber@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20171102070312.18903-14-lsahlber@redhat.com/mbox/",
    "series": [
        {
            "id": 11445,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/11445/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=11445",
            "date": "2017-11-02T07:03:12",
            "name": "cifs: remove rfc1002 header from all smb2 requests",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/11445/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/833231/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/833231/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linux-cifs-owner@vger.kernel.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-cifs-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
            "ext-mx01.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com",
            "ext-mx01.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=lsahlber@redhat.com"
        ],
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3ySGLT4hjvz9t2V\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  2 Nov 2017 18:05:05 +1100 (AEDT)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1755220AbdKBHFE (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tThu, 2 Nov 2017 03:05:04 -0400",
            "from mx1.redhat.com ([209.132.183.28]:40518 \"EHLO mx1.redhat.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1755219AbdKBHFD (ORCPT <rfc822;linux-cifs@vger.kernel.org>);\n\tThu, 2 Nov 2017 03:05:03 -0400",
            "from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id BF6E581DE2;\n\tThu,  2 Nov 2017 07:05:03 +0000 (UTC)",
            "from test1190.test.redhat.com (vpn2-54-17.bne.redhat.com\n\t[10.64.54.17])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 43ED060C98;\n\tThu,  2 Nov 2017 07:05:01 +0000 (UTC)"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com BF6E581DE2",
        "From": "Ronnie Sahlberg <lsahlber@redhat.com>",
        "To": "linux-cifs <linux-cifs@vger.kernel.org>",
        "Cc": "Steve French <smfrench@gmail.com>",
        "Subject": "[PATCH 13/19] cifs: remove rfc1002 header from smb2 read/write\n\trequests",
        "Date": "Thu,  2 Nov 2017 18:03:06 +1100",
        "Message-Id": "<20171102070312.18903-14-lsahlber@redhat.com>",
        "In-Reply-To": "<20171102070312.18903-1-lsahlber@redhat.com>",
        "References": "<20171102070312.18903-1-lsahlber@redhat.com>",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.12",
        "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.25]);\n\tThu, 02 Nov 2017 07:05:03 +0000 (UTC)",
        "Sender": "linux-cifs-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<linux-cifs.vger.kernel.org>",
        "X-Mailing-List": "linux-cifs@vger.kernel.org"
    },
    "content": "Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>\n---\n fs/cifs/smb2pdu.c | 42 ++++++++++++++++++++----------------------\n fs/cifs/smb2pdu.h |  2 +-\n 2 files changed, 21 insertions(+), 23 deletions(-)",
    "diff": "diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c\nindex 5dc0ec2cad1e..b0d4e9d15e29 100644\n--- a/fs/cifs/smb2pdu.c\n+++ b/fs/cifs/smb2pdu.c\n@@ -2469,7 +2469,7 @@ smb2_new_read_req(void **buf, unsigned int *total_len,\n \tstruct smb2_sync_hdr *shdr;\n \n \trc = smb2_plain_req_init(SMB2_READ, io_parms->tcon, (void **) &req,\n-\t\t\t\t total_len);\n+\t\t\t     total_len);\n \tif (rc)\n \t\treturn rc;\n \tif (io_parms->tcon->ses->server == NULL)\n@@ -2679,7 +2679,7 @@ SMB2_read(const unsigned int xid, struct cifs_io_parms *io_parms,\n \n \tiov[0].iov_base = &req_len;\n \tiov[0].iov_len = sizeof(__be32);\n-\tiov[1].iov_base = req;\n+\tiov[1].iov_base = (char *)req;\n \tiov[1].iov_len = total_len;\n \n \trc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, &rsp_iov);\n@@ -2784,8 +2784,10 @@ smb2_async_writev(struct cifs_writedata *wdata,\n \tstruct TCP_Server_Info *server = tcon->ses->server;\n \tstruct kvec iov[2];\n \tstruct smb_rqst rqst = { };\n+\tunsigned int total_len;\n+\t__be32 rfc1002_marker;\n \n-\trc = small_smb2_init(SMB2_WRITE, tcon, (void **) &req);\n+\trc = smb2_plain_req_init(SMB2_WRITE, tcon, (void **) &req, &total_len);\n \tif (rc) {\n \t\tif (rc == -EAGAIN && wdata->credits) {\n \t\t\t/* credits was reset by reconnect */\n@@ -2801,7 +2803,7 @@ smb2_async_writev(struct cifs_writedata *wdata,\n \tif (encryption_required(tcon))\n \t\tflags |= CIFS_TRANSFORM_REQ;\n \n-\tshdr = get_sync_hdr(req);\n+\tshdr = (struct smb2_sync_hdr *)req;\n \tshdr->ProcessId = cpu_to_le32(wdata->cfile->pid);\n \n \treq->PersistentFileId = wdata->cfile->fid.persistent_fid;\n@@ -2810,16 +2812,16 @@ smb2_async_writev(struct cifs_writedata *wdata,\n \treq->WriteChannelInfoLength = 0;\n \treq->Channel = 0;\n \treq->Offset = cpu_to_le64(wdata->offset);\n-\t/* 4 for rfc1002 length field */\n \treq->DataOffset = cpu_to_le16(\n-\t\t\t\toffsetof(struct smb2_write_req, Buffer) - 4);\n+\t\t\t\toffsetof(struct smb2_write_req, Buffer));\n \treq->RemainingBytes = 0;\n \n \t/* 4 for rfc1002 length field and 1 for Buffer */\n \tiov[0].iov_len = 4;\n-\tiov[0].iov_base = req;\n-\tiov[1].iov_len = get_rfc1002_length(req) - 1;\n-\tiov[1].iov_base = (char *)req + 4;\n+\trfc1002_marker = cpu_to_be32(total_len - 1 + wdata->bytes);\n+\tiov[0].iov_base = &rfc1002_marker;\n+\tiov[1].iov_len = total_len - 1;\n+\tiov[1].iov_base = (char *)req;\n \n \trqst.rq_iov = iov;\n \trqst.rq_nvec = 2;\n@@ -2833,8 +2835,6 @@ smb2_async_writev(struct cifs_writedata *wdata,\n \n \treq->Length = cpu_to_le32(wdata->bytes);\n \n-\tinc_rfc1001_len(&req->hdr, wdata->bytes - 1 /* Buffer */);\n-\n \tif (wdata->credits) {\n \t\tshdr->CreditCharge = cpu_to_le16(DIV_ROUND_UP(wdata->bytes,\n \t\t\t\t\t\t    SMB2_MAX_BUFFER_SIZE));\n@@ -2877,13 +2877,15 @@ SMB2_write(const unsigned int xid, struct cifs_io_parms *io_parms,\n \tint resp_buftype;\n \tstruct kvec rsp_iov;\n \tint flags = 0;\n+\tunsigned int total_len;\n \n \t*nbytes = 0;\n \n \tif (n_vec < 1)\n \t\treturn rc;\n \n-\trc = small_smb2_init(SMB2_WRITE, io_parms->tcon, (void **) &req);\n+\trc = smb2_plain_req_init(SMB2_WRITE, io_parms->tcon, (void **) &req,\n+\t\t\t     &total_len);\n \tif (rc)\n \t\treturn rc;\n \n@@ -2893,7 +2895,7 @@ SMB2_write(const unsigned int xid, struct cifs_io_parms *io_parms,\n \tif (encryption_required(io_parms->tcon))\n \t\tflags |= CIFS_TRANSFORM_REQ;\n \n-\treq->hdr.sync_hdr.ProcessId = cpu_to_le32(io_parms->pid);\n+\treq->sync_hdr.ProcessId = cpu_to_le32(io_parms->pid);\n \n \treq->PersistentFileId = io_parms->persistent_fid;\n \treq->VolatileFileId = io_parms->volatile_fid;\n@@ -2902,20 +2904,16 @@ SMB2_write(const unsigned int xid, struct cifs_io_parms *io_parms,\n \treq->Channel = 0;\n \treq->Length = cpu_to_le32(io_parms->length);\n \treq->Offset = cpu_to_le64(io_parms->offset);\n-\t/* 4 for rfc1002 length field */\n \treq->DataOffset = cpu_to_le16(\n-\t\t\t\toffsetof(struct smb2_write_req, Buffer) - 4);\n+\t\t\t\toffsetof(struct smb2_write_req, Buffer));\n \treq->RemainingBytes = 0;\n \n \tiov[0].iov_base = (char *)req;\n-\t/* 4 for rfc1002 length field and 1 for Buffer */\n-\tiov[0].iov_len = get_rfc1002_length(req) + 4 - 1;\n-\n-\t/* length of entire message including data to be written */\n-\tinc_rfc1001_len(req, io_parms->length - 1 /* Buffer */);\n+\t/* 1 for Buffer */\n+\tiov[0].iov_len = total_len - 1;\n \n-\trc = SendReceive2(xid, io_parms->tcon->ses, iov, n_vec + 1,\n-\t\t\t  &resp_buftype, flags, &rsp_iov);\n+\trc = SendReceive3(xid, io_parms->tcon->ses, iov, n_vec + 1,\n+\t\t\t      &resp_buftype, flags, &rsp_iov);\n \tcifs_small_buf_release(req);\n \trsp = (struct smb2_write_rsp *)rsp_iov.iov_base;\n \ndiff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h\nindex 0c33fc8cce71..3c856f058be7 100644\n--- a/fs/cifs/smb2pdu.h\n+++ b/fs/cifs/smb2pdu.h\n@@ -868,7 +868,7 @@ struct smb2_read_rsp {\n #define SMB2_WRITEFLAG_WRITE_UNBUFFERED\t0x00000002\t/* SMB3.02 or later */\n \n struct smb2_write_req {\n-\tstruct smb2_hdr hdr;\n+\tstruct smb2_sync_hdr sync_hdr;\n \t__le16 StructureSize; /* Must be 49 */\n \t__le16 DataOffset; /* offset from start of SMB2 header to write data */\n \t__le32 Length;\n",
    "prefixes": [
        "13/19"
    ]
}