Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/812115/?format=api
{ "id": 812115, "url": "http://patchwork.ozlabs.org/api/patches/812115/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20170910112149.21358-17-robdclark@gmail.com/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api", "name": "U-Boot", "link_name": "uboot", "list_id": "u-boot.lists.denx.de", "list_email": "u-boot@lists.denx.de", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170910112149.21358-17-robdclark@gmail.com>", "list_archive_url": null, "date": "2017-09-10T11:21:33", "name": "[U-Boot,v3,8/9] fs/fat: fix case for FAT shortnames", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": false, "hash": "276bb99328bbf326ef6622200c8e4cac3a9ecc33", "submitter": { "id": 18760, "url": "http://patchwork.ozlabs.org/api/people/18760/?format=api", "name": "Rob Clark", "email": "robdclark@gmail.com" }, "delegate": { "id": 3651, "url": "http://patchwork.ozlabs.org/api/users/3651/?format=api", "username": "trini", "first_name": "Tom", "last_name": "Rini", "email": "trini@ti.com" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20170910112149.21358-17-robdclark@gmail.com/mbox/", "series": [ { "id": 2383, "url": "http://patchwork.ozlabs.org/api/series/2383/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=2383", "date": "2017-09-10T11:21:17", "name": "efi_loader: enough UEFI for standard distro boot", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/2383/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/812115/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/812115/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<u-boot-bounces@lists.denx.de>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": [ "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"g5IM3Dtv\"; dkim-atps=neutral" ], "Received": [ "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xqpt84D2Pz9sDB\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 10 Sep 2017 21:36:32 +1000 (AEST)", "by lists.denx.de (Postfix, from userid 105)\n\tid 2A5A0C21E8C; Sun, 10 Sep 2017 11:27:12 +0000 (UTC)", "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id EF2FCC21F44;\n\tSun, 10 Sep 2017 11:24:25 +0000 (UTC)", "by lists.denx.de (Postfix, from userid 105)\n\tid A5BE6C21F28; Sun, 10 Sep 2017 11:23:09 +0000 (UTC)", "from mail-qk0-f193.google.com (mail-qk0-f193.google.com\n\t[209.85.220.193])\n\tby lists.denx.de (Postfix) with ESMTPS id DF189C21EBF\n\tfor <u-boot@lists.denx.de>; Sun, 10 Sep 2017 11:23:02 +0000 (UTC)", "by mail-qk0-f193.google.com with SMTP id c69so3970239qke.5\n\tfor <u-boot@lists.denx.de>; Sun, 10 Sep 2017 04:23:02 -0700 (PDT)", "from localhost ([2601:184:4780:aac0:25f8:dd96:a084:785a])\n\tby smtp.gmail.com with ESMTPSA id\n\tp60sm4231329qtd.93.2017.09.10.04.22.59\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tSun, 10 Sep 2017 04:23:00 -0700 (PDT)" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de", "X-Spam-Level": "", "X-Spam-Status": "No, score=-0.0 required=5.0 tests=FREEMAIL_FROM,\n\tRCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID\n\tautolearn=unavailable autolearn_force=no version=3.4.0", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=Y9Zc0Nv79pXQfDgDO26uLmB5Oesm4aAENBswlPKEk6U=;\n\tb=g5IM3Dtv4U4AkacmpI01t7FWK/azE2ZgRMDHZD6YvG905QG7D2HIvFDMX+5jbJ70+x\n\tUeu6KlkXNtPE8/RNlRyrE+kN/cj3G3aNEnKEyhg3SLpmJIjq1k+FBTOxWSrymsohdK+O\n\tG/8i2KANuhBObTmfX+TyJ2kIiLPUW3VjqzYIzDNr4HNdNxBLnKVyl+0YDSmNJ+QJzRyt\n\tmEb8eEGlgP88swb+P5RoZfUbX0ICVBU2+7HIiWrKzxyLM0isrwjR8Lsb7eGcRpJp6h+0\n\tyN8HywmQuoiyhTCE+nLy7FtOu/1Z0ZQwTKywcf7uFYN4adT7LPs6E8vKN9QwARYbL6Q1\n\tHzWw==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=Y9Zc0Nv79pXQfDgDO26uLmB5Oesm4aAENBswlPKEk6U=;\n\tb=CsLdd9KWtIvXPstaIXUc30NlnreeDms57W3QgfE2JRaA7xwYPmbVfhHKsvfNdcX0Kg\n\tC4XvHpXf0HHkOh7DoZtmESCEQYMQ3Qnwn2W4KSNEImjfvW2EVH4n1Cljxv63olvj9CcO\n\trxfxFOJubdASzfBR8jSvybupCO2hMldELeB85Lm1Q4auVitdfJYvt9/53+YLX5nJFZWg\n\tr7K9rvJe1LMdjsIKTaZ0Onn6rvN19FkMLOLozh2L5o9N67GPciVajhZICPSlX8I1TbUx\n\twhNOkTryeXoj4MKThIs34AgfBy/1sd71YYhIoYtuJaJHD84hHXkK6fXTlxv90IXQwr4C\n\tpByw==", "X-Gm-Message-State": "AHPjjUhjKC9/21q+qI6qYNu8o3aPt/n8bqv0nl2RqIsdTDE463Cd5GSI\n\t4texuY2YYcrb0hK//4o=", "X-Google-Smtp-Source": "AOwi7QDsmbSfHv448a/Gw6Jb5hMCdkTJGZMmOg4uFRTNjtvavTOgxeTkVtnZrZZk/+dcltiCgue0Vg==", "X-Received": "by 10.55.75.8 with SMTP id y8mr10023302qka.255.1505042581565;\n\tSun, 10 Sep 2017 04:23:01 -0700 (PDT)", "From": "Rob Clark <robdclark@gmail.com>", "To": "U-Boot Mailing List <u-boot@lists.denx.de>", "Date": "Sun, 10 Sep 2017 07:21:33 -0400", "Message-Id": "<20170910112149.21358-17-robdclark@gmail.com>", "X-Mailer": "git-send-email 2.13.5", "In-Reply-To": "<20170910112149.21358-1-robdclark@gmail.com>", "References": "<20170910112149.21358-1-robdclark@gmail.com>", "MIME-Version": "1.0", "Cc": "Stephen Warren <swarren@nvidia.com>,\n\tHeinrich Schuchardt <xypron.glpk@gmx.de>,\n\tPhilipp Skadorov <philipp.skadorov@savoirfairelinux.com>,\n\tGenevieve Chan <ccheauya@altera.com>, Tien Fong Chee <tfchee@altera.com>", "Subject": "[U-Boot] [PATCH v3 8/9] fs/fat: fix case for FAT shortnames", "X-BeenThere": "u-boot@lists.denx.de", "X-Mailman-Version": "2.1.18", "Precedence": "list", "List-Id": "U-Boot discussion <u-boot.lists.denx.de>", "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>", "List-Archive": "<http://lists.denx.de/pipermail/u-boot/>", "List-Post": "<mailto:u-boot@lists.denx.de>", "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>", "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "base64", "Errors-To": "u-boot-bounces@lists.denx.de", "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>" }, "content": "Noticed when comparing our output to linux. There are some lcase bits\nwhich control whether filename and/or extension should be downcase'd.\n\nSigned-off-by: Rob Clark <robdclark@gmail.com>\nReviewed-by: Łukasz Majewski <lukma@denx.de>\n---\n fs/fat/fat.c | 16 ++++++++++------\n fs/fat/fat_write.c | 4 ++--\n include/fat.h | 6 +++++-\n 3 files changed, 17 insertions(+), 9 deletions(-)", "diff": "diff --git a/fs/fat/fat.c b/fs/fat/fat.c\nindex c951d84f57..65873a2c2a 100644\n--- a/fs/fat/fat.c\n+++ b/fs/fat/fat.c\n@@ -29,11 +29,13 @@ static const int vfat_enabled = 0;\n #endif\n \n /*\n- * Convert a string to lowercase.\n+ * Convert a string to lowercase. Converts at most 'len' characters,\n+ * 'len' may be larger than the length of 'str' if 'str' is NULL\n+ * terminated.\n */\n-static void downcase(char *str)\n+static void downcase(char *str, size_t len)\n {\n-\twhile (*str != '\\0') {\n+\twhile (*str != '\\0' && len--) {\n \t\t*str = tolower(*str);\n \t\tstr++;\n \t}\n@@ -131,10 +133,13 @@ static void get_name(dir_entry *dirent, char *s_name)\n \tptr = s_name;\n \twhile (*ptr && *ptr != ' ')\n \t\tptr++;\n+\tif (dirent->lcase & CASE_LOWER_BASE)\n+\t\tdowncase(s_name, (unsigned)(ptr - s_name));\n \tif (dirent->ext[0] && dirent->ext[0] != ' ') {\n-\t\t*ptr = '.';\n-\t\tptr++;\n+\t\t*ptr++ = '.';\n \t\tmemcpy(ptr, dirent->ext, 3);\n+\t\tif (dirent->lcase & CASE_LOWER_EXT)\n+\t\t\tdowncase(ptr, 3);\n \t\tptr[3] = '\\0';\n \t\twhile (*ptr && *ptr != ' ')\n \t\t\tptr++;\n@@ -144,7 +149,6 @@ static void get_name(dir_entry *dirent, char *s_name)\n \t\t*s_name = '\\0';\n \telse if (*s_name == aRING)\n \t\t*s_name = DELETED_FLAG;\n-\tdowncase(s_name);\n }\n \n static int flush_dirty_fat_buffer(fsdata *mydata);\ndiff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c\nindex 4ca024c208..d0468baf8f 100644\n--- a/fs/fat/fat_write.c\n+++ b/fs/fat/fat_write.c\n@@ -345,7 +345,7 @@ get_long_file_name(fsdata *mydata, int curclust, __u8 *cluster,\n \t\t*l_name = '\\0';\n \telse if (*l_name == aRING)\n \t\t*l_name = DELETED_FLAG;\n-\tdowncase(l_name);\n+\tdowncase(l_name, INT_MAX);\n \n \t/* Return the real directory entry */\n \t*retdent = realdent;\n@@ -981,7 +981,7 @@ static int do_fat_write(const char *filename, void *buffer, loff_t size,\n \n \tmemcpy(l_filename, filename, name_len);\n \tl_filename[name_len] = 0; /* terminate the string */\n-\tdowncase(l_filename);\n+\tdowncase(l_filename, INT_MAX);\n \n \tstartsect = mydata->rootdir_sect;\n \tretdent = find_directory_entry(mydata, startsect,\ndiff --git a/include/fat.h b/include/fat.h\nindex 83cd90017e..0f58939124 100644\n--- a/include/fat.h\n+++ b/include/fat.h\n@@ -128,10 +128,14 @@ typedef struct volume_info\n \t/* Boot sign comes last, 2 bytes */\n } volume_info;\n \n+/* see dir_entry::lcase: */\n+#define CASE_LOWER_BASE\t8\t/* base (name) is lower case */\n+#define CASE_LOWER_EXT\t16\t/* extension is lower case */\n+\n typedef struct dir_entry {\n \tchar\tname[8],ext[3];\t/* Name and extension */\n \t__u8\tattr;\t\t/* Attribute bits */\n-\t__u8\tlcase;\t\t/* Case for base and extension */\n+\t__u8\tlcase;\t\t/* Case for name and ext (CASE_LOWER_x) */\n \t__u8\tctime_ms;\t/* Creation time, milliseconds */\n \t__u16\tctime;\t\t/* Creation time */\n \t__u16\tcdate;\t\t/* Creation date */\n", "prefixes": [ "U-Boot", "v3", "8/9" ] }