Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/811972/?format=api
{ "id": 811972, "url": "http://patchwork.ozlabs.org/api/patches/811972/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20170909171606.20029-9-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": "<20170909171606.20029-9-robdclark@gmail.com>", "list_archive_url": null, "date": "2017-09-09T17:15:59", "name": "[U-Boot,v3,8/9] fs/fat: fix case for FAT shortnames", "commit_ref": null, "pull_url": null, "state": "accepted", "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/20170909171606.20029-9-robdclark@gmail.com/mbox/", "series": [ { "id": 2355, "url": "http://patchwork.ozlabs.org/api/series/2355/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=2355", "date": "2017-09-09T17:15:51", "name": "fs/fat: cleanups + readdir implementation", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/2355/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/811972/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/811972/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=\"Mmlp/jQx\"; dkim-atps=neutral" ], "Received": [ "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xqLXx51cRz9t16\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 10 Sep 2017 03:20:01 +1000 (AEST)", "by lists.denx.de (Postfix, from userid 105)\n\tid 0ECB7C21C58; Sat, 9 Sep 2017 17:19:09 +0000 (UTC)", "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 53097C21F2A;\n\tSat, 9 Sep 2017 17:17:48 +0000 (UTC)", "by lists.denx.de (Postfix, from userid 105)\n\tid 769C8C21E8C; Sat, 9 Sep 2017 17:17:02 +0000 (UTC)", "from mail-qt0-f193.google.com (mail-qt0-f193.google.com\n\t[209.85.216.193])\n\tby lists.denx.de (Postfix) with ESMTPS id B0316C21E55\n\tfor <u-boot@lists.denx.de>; Sat, 9 Sep 2017 17:16:56 +0000 (UTC)", "by mail-qt0-f193.google.com with SMTP id u48so401064qtc.4\n\tfor <u-boot@lists.denx.de>; Sat, 09 Sep 2017 10:16:56 -0700 (PDT)", "from localhost ([2601:184:4780:aac0:25f8:dd96:a084:785a])\n\tby smtp.gmail.com with ESMTPSA id\n\tf4sm3310144qte.76.2017.09.09.10.16.54\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tSat, 09 Sep 2017 10:16:54 -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=Mmlp/jQxxLIXqAwGHi8GzVFUySn9GNfQPAtYov09aDH20T+5diaDlvEHKVQcsGbFLe\n\tgZqef8z3AhV15T+FcB0bjKdKmk4gB1p7uctSUkz9sF7Z341EgrG8f+Rww4rLzWZSSfUT\n\tTjdU2WGDXGqRg5tW1DFa3l2r/RIyF6eZb61Whj/Kab2HuoHLFW19dm6jYdQPfjJLzBns\n\tn9zp6hbEX2Id4Rgx2UuqQSm+N1L/FqD0TNj6mismH2RZlPVmnJ+XzaZs63AMw1f02LxG\n\tLiN4FCkjRoumwvPTLOQkh8Fv0Gtc9qNmAeyF77RkpyzX1D81HOVBs4OfxZB2j12hjk3H\n\tqOtg==", "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=GmBocJMBBqfeeqbZz3poA6SvWH/vNJVfJpu1tDz3bUiViFoUR8aLZGAOXOvGk4D7yP\n\t6ljnbG7QYZ0j4ktRJQ4hSAh950ZkrhhrDjiucAuYEpNgraCWs/JB4tRFyQPd2uFLRzOH\n\tQ1CWH809icAlVuK/B5BdtH1UwS1Ww/roU17tiyB9DWxRBlSiWBtFZRRsc8bCkwSTVrE7\n\tGOZ8Oy48HfOMAcB96NnW4Br3BiNj0+UFsk4oaRpfJx6jIFPQ5ER4F2Ri7kTO9H/H0qCv\n\tLzexkQ2CJ0TH1KYqCKtHKzHlme0Nv+tTRQEKNYAysCi5DWBxJEgPQqkLd2qlqBnrLRRl\n\tFksg==", "X-Gm-Message-State": "AHPjjUizteH/l05UgQZD7taWexq46/YniU/4uMABrihrAJ3bu7oUpu7k\n\tjt2QI30QcrhoJn28TVc=", "X-Google-Smtp-Source": "AOwi7QCH0/8DmhtypWQNmslTbKL37M6sl45KkbLDpDuAvKVwXsxLBvsNQ+HhLCGQ5URxVbVUG+5MLQ==", "X-Received": "by 10.237.59.26 with SMTP id p26mr9707063qte.304.1504977415408; \n\tSat, 09 Sep 2017 10:16:55 -0700 (PDT)", "From": "Rob Clark <robdclark@gmail.com>", "To": "U-Boot Mailing List <u-boot@lists.denx.de>", "Date": "Sat, 9 Sep 2017 13:15:59 -0400", "Message-Id": "<20170909171606.20029-9-robdclark@gmail.com>", "X-Mailer": "git-send-email 2.13.5", "In-Reply-To": "<20170909171606.20029-1-robdclark@gmail.com>", "References": "<20170909171606.20029-1-robdclark@gmail.com>", "MIME-Version": "1.0", "Cc": "Philipp Skadorov <philipp.skadorov@savoirfairelinux.com>,\n\tHeinrich Schuchardt <xypron.glpk@gmx.de>,\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" ] }