get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 805993,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/805993/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/patch/1503686915-57151-1-git-send-email-adilger@dilger.ca/",
    "project": {
        "id": 8,
        "url": "http://patchwork.ozlabs.org/api/1.2/projects/8/?format=api",
        "name": "Linux ext4 filesystem development",
        "link_name": "linux-ext4",
        "list_id": "linux-ext4.vger.kernel.org",
        "list_email": "linux-ext4@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1503686915-57151-1-git-send-email-adilger@dilger.ca>",
    "list_archive_url": null,
    "date": "2017-08-25T18:48:35",
    "name": "ext4: avoid Y2038 overflow in recently_deleted()",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "2ab22b71017f221c898ae0a9aea778c39e92c962",
    "submitter": {
        "id": 4514,
        "url": "http://patchwork.ozlabs.org/api/1.2/people/4514/?format=api",
        "name": "Andreas Dilger",
        "email": "adilger@dilger.ca"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-ext4/patch/1503686915-57151-1-git-send-email-adilger@dilger.ca/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/805993/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/805993/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linux-ext4-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming@ozlabs.org",
        "Delivered-To": "patchwork-incoming@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-ext4-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xf9D813Bbz9s8V\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat, 26 Aug 2017 04:48:40 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1756498AbdHYSsj (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 25 Aug 2017 14:48:39 -0400",
            "from smtp-out-so.shaw.ca ([64.59.136.139]:55707 \"EHLO\n\tsmtp-out-so.shaw.ca\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1754890AbdHYSsi (ORCPT\n\t<rfc822; linux-ext4@vger.kernel.org>); Fri, 25 Aug 2017 14:48:38 -0400",
            "from cabot.adilger.int ([70.77.216.213]) by shaw.ca with SMTP\n\tid lJeldG9o2DJTWlJemduMMN; Fri, 25 Aug 2017 12:48:37 -0600"
        ],
        "X-Authority-Analysis": "v=2.2 cv=B4DJ6KlM c=1 sm=1 tr=0\n\ta=BQvS1EmAg2ttxjPVUuc1UQ==:117 a=BQvS1EmAg2ttxjPVUuc1UQ==:17\n\ta=RPJ6JBhKAAAA:8\n\ta=__5HBVkf72bQEPGow0AA:9 a=fa_un-3J20JGBB2Tu-mn:22",
        "From": "Andreas Dilger <adilger@dilger.ca>",
        "To": "tytso@mit.edu",
        "Cc": "linux-ext4@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,\n\tAndreas Dilger <adilger@dilger.ca>",
        "Subject": "[PATCH] ext4: avoid Y2038 overflow in recently_deleted()",
        "Date": "Fri, 25 Aug 2017 12:48:35 -0600",
        "Message-Id": "<1503686915-57151-1-git-send-email-adilger@dilger.ca>",
        "X-Mailer": "git-send-email 1.8.0",
        "X-CMAE-Envelope": "MS4wfM6F/wSpxrzVdNeATGVxAquIx8LfDjD8FYZpnmdoat2cBtFPML6rBX9uxk4q2XUOpXSAs9ed+JsF2kLTFzVzQlg0dda+7C4+U/TPnxPxFTzcy4yIaMHG\n\tLzSO5sVMwFfnvhTHDzrxJM8/DCMpOaX1K8rz3kXAmwKUBKGzxWp2vlOJlvvyj1hiH1StVqtGdHNaiZSMe7YmiHpzHak5txrEKwp4/U1Q1LqqS4YKtq6WgOdW\n\tgLK06jl5EhGiZeCfaG3boQ==",
        "Sender": "linux-ext4-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<linux-ext4.vger.kernel.org>",
        "X-Mailing-List": "linux-ext4@vger.kernel.org"
    },
    "content": "Avoid a 32-bit time overflow in recently_deleted() since i_dtime\n(inode deletion time) is stored only as a 32-bit value on disk.\nSince i_dtime isn't used for much beyond a boolean value in e2fsck\nand is otherwise only used in this function in the kernel, there is\nno benefit to use more space in the inode for this field on disk.\n\nInstead, compare only the relative deletion time with the low\n32 bits of the time using the newly-added time_before32() helper,\nwhich is similar to time_before() and time_after() for jiffies.\n\nIncrease RECENTCY_DIRTY to 300s based on Ted's comments about\nusage experience at Google.\n\nSigned-off-by: Andreas Dilger <adilger@dilger.ca>\nChange-Id: I7402e1b3d49ea326f872ec8324933f42b502b9be\n---\n fs/ext4/ialloc.c     | 19 +++++++++++++------\n include/linux/time.h | 15 +++++++++++++++\n 2 files changed, 28 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c\nindex 507bfb3..3e73acb 100644\n--- a/fs/ext4/ialloc.c\n+++ b/fs/ext4/ialloc.c\n@@ -692,16 +692,17 @@ static int find_group_other(struct super_block *sb, struct inode *parent,\n  * somewhat arbitrary...)\n  */\n #define RECENTCY_MIN\t5\n-#define RECENTCY_DIRTY\t30\n+#define RECENTCY_DIRTY\t300\n \n static int recently_deleted(struct super_block *sb, ext4_group_t group, int ino)\n {\n \tstruct ext4_group_desc\t*gdp;\n \tstruct ext4_inode\t*raw_inode;\n \tstruct buffer_head\t*bh;\n-\tunsigned long\t\tdtime, now;\n-\tint\tinodes_per_block = EXT4_SB(sb)->s_inodes_per_block;\n-\tint\toffset, ret = 0, recentcy = RECENTCY_MIN;\n+\tint inodes_per_block = EXT4_SB(sb)->s_inodes_per_block;\n+\tint offset, ret = 0;\n+\tint recentcy = RECENTCY_MIN;\n+\tu32 dtime, now;\n \n \tgdp = ext4_get_group_desc(sb, group, NULL);\n \tif (unlikely(!gdp))\n@@ -718,12 +719,18 @@ static int recently_deleted(struct super_block *sb, ext4_group_t group, int ino)\n \n \toffset = (ino % inodes_per_block) * EXT4_INODE_SIZE(sb);\n \traw_inode = (struct ext4_inode *) (bh->b_data + offset);\n+\n+\t/* i_dtime is only 32 bits on disk, but we only care about relative\n+\t * times in the range of a few minutes (i.e. long enough to sync a\n+\t * recently-deleted inode to disk), so using the low 32 bits of the\n+\t * clock (a 68 year range) is enough, see time_before32() */\n \tdtime = le32_to_cpu(raw_inode->i_dtime);\n-\tnow = get_seconds();\n+\tnow = ktime_get_real_seconds();\n \tif (buffer_dirty(bh))\n \t\trecentcy += RECENTCY_DIRTY;\n \n-\tif (dtime && (dtime < now) && (now < dtime + recentcy))\n+\tif (dtime && time_before32(dtime, now) &&\n+\t    time_before32(now, dtime + recentcy))\n \t\tret = 1;\n out:\n \tbrelse(bh);\ndiff --git a/include/linux/time.h b/include/linux/time.h\nindex 4abb32d..3877136 100644\n--- a/include/linux/time.h\n+++ b/include/linux/time.h\n@@ -285,4 +285,19 @@ static inline bool itimerspec64_valid(const struct itimerspec64 *its)\n \treturn true;\n }\n \n+/**\n+ * time_after32 - compare two 32-bit relative times\n+ * @a:\tthe time which may be after @b\n+ * @b:\tthe time which may be before @a\n+ *\n+ * time_after32(a, b) returns true if the time @a is after time @b.\n+ * time_before32(b, a) returns true if the time @b is before time @a.\n+ *\n+ * Similar to time_after(), compare two 32-bit timestamps for relative\n+ * times.  This is useful for comparing 32-bit seconds values that can't\n+ * be converted to 64-bit values (e.g. due to disk format or wire protocol\n+ * issues) when it is known that the times are less than 68 years apart.\n+ */\n+#define time_after32(a, b)\t((s32)((u32)(b) - (u32)(a)) < 0)\n+#define time_before32(b, a)\ttime_after32(a, b)\n #endif\n",
    "prefixes": []
}