[{"id":1767557,"web_url":"http://patchwork.ozlabs.org/comment/1767557/","msgid":"<CAPnjgZ0-hirC_wiYmL77jxgd_=4_eGGN9K-d9dN5dVgOCyujaw@mail.gmail.com>","list_archive_url":null,"date":"2017-09-13T04:27:41","subject":"Re: [U-Boot] [PATCH] fs/fat: fix fatbuf leak","submitter":{"id":6170,"url":"http://patchwork.ozlabs.org/api/people/6170/","name":"Simon Glass","email":"sjg@chromium.org"},"content":"On 12 September 2017 at 14:40, Rob Clark <robdclark@gmail.com> wrote:\n> A new fatbuf was allocated by get_fs_info() (called by fat_itr_root()),\n> but not freed, resulting in eventually running out of memory.  Spotted\n> by running 'ls -r' in a large FAT filesystem from Shell.efi.\n>\n> fatbuf is mainly used to cache FAT entry lookups (get_fatent())..\n> possibly once fat_write.c it can move into the iterator to simplify\n> this.\n>\n> Signed-off-by: Rob Clark <robdclark@gmail.com>\n> ---\n> I can squash this back in to the earlier readdir patches and resend\n> them if that is preferred.\n>\n>  fs/fat/fat.c | 23 ++++++++++++++++-------\n>  1 file changed, 16 insertions(+), 7 deletions(-)\n\nReviewed-by: Simon Glass <sjg@chromium.org>","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=google.com header.i=@google.com\n\theader.b=\"EJdO5yuI\"; \n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"KL1nHK9e\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xsTVj2YGRz9rvt\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 14:40:29 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 15A09C2251F; Wed, 13 Sep 2017 04:33:45 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 796E5C224F1;\n\tWed, 13 Sep 2017 04:31:09 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 98D55C224D6; Wed, 13 Sep 2017 04:28:08 +0000 (UTC)","from mail-qt0-f174.google.com (mail-qt0-f174.google.com\n\t[209.85.216.174])\n\tby lists.denx.de (Postfix) with ESMTPS id D7C64C223D4\n\tfor <u-boot@lists.denx.de>; Wed, 13 Sep 2017 04:28:03 +0000 (UTC)","by mail-qt0-f174.google.com with SMTP id b1so20240100qtc.4\n\tfor <u-boot@lists.denx.de>; Tue, 12 Sep 2017 21:28:03 -0700 (PDT)","by 10.200.37.200 with HTTP; Tue, 12 Sep 2017 21:27:41 -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=RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0","DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n\ts=20161025; \n\th=mime-version:sender:in-reply-to:references:from:date:message-id\n\t:subject:to:cc;\n\tbh=BnsUd6BOk8SQSVdcQZMEq2ueIZBtNXyoM+fJRUZL3Gw=;\n\tb=EJdO5yuIdjuocnXwsRGBhc0EOzxF8NejEQkXWRWs1+3ZZXm8Fcbwi3BqFSJ0ykF9Td\n\tLjWOS9ZjSRduj9ZgBunuwgyOTQPF+cCbXx7KailA40yt4ANSVf4jpH4Dt/4rhwUdlZOl\n\tYakKSJAAEkcz9EdsTO3/23xAY0c4c5/vJd7xrwjIrXBIUk3rIUUv496xmskPYhOW1rvg\n\tIvry8n758n6zxZy79uYi8yYNXiolSJ7qqkqM/cZGDH2aL58OQTC9rAYnF1Olnxl/twSE\n\t8b8AckH8zoGj86lveDVoccqDHIM2rFsuRmLqPhJzVyPDMCrNWAq7fKBPOkAbZJMntHyr\n\t9+5Q==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:sender:in-reply-to:references:from:date:message-id\n\t:subject:to:cc;\n\tbh=BnsUd6BOk8SQSVdcQZMEq2ueIZBtNXyoM+fJRUZL3Gw=;\n\tb=KL1nHK9eCiN+HqkYvXMHg/7nK1MXwFMVEKhW33p5brJzJ0d8dPR1RFMPvArd2sdXy3\n\txi8OAsZFkou87pkqhlgdJOgAMHR6Inb+l43lTBSOPum9Hk4VRxzaTYXa9r3zGCeTw8sX\n\teD4t8UN4auTfpnEi4kjIldNP0bLS6HGRQmec4="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:sender:in-reply-to:references:from\n\t:date:message-id:subject:to:cc;\n\tbh=BnsUd6BOk8SQSVdcQZMEq2ueIZBtNXyoM+fJRUZL3Gw=;\n\tb=Zgk+5y2Om+7pBbCWuPjCnojof0IhX9B0e7WdBlZOm8yxZQuHY27DO6xMmO2d0M2/+9\n\tFTmFGA5X4aEJ9smiWK+IxxqAIwsSdgHO8+F4Byvy3eixeQzDD0mVo0sZDQ7Wg2qbGqoA\n\tfKw/Gb57l1gMUKyorws8bNXLaRQ6TF7vfJMAJVH8EfYoMNPqvc2n8ylHUFifQuePYq4J\n\t1SLaziAtELnfA+4f2e8luX4rEfEr25iJFcXfWkYHQHqlpJmNt4x4IePS3Rura/IV8Crt\n\tQYcuhd3v+f6drVJlWJAEnony/0VxCzSbmclzrgLp+6GRs8wL6/ebl0K1ObLx2A0YE5Zd\n\tyrBQ==","X-Gm-Message-State":"AHPjjUhujKy07o29uKgq1neKiRxSJBT2Xx01Xfdvls3+ltXnyqbOtKqQ\n\tw8SWeKSY27gNzpWvnfPxDmAV7ZFGMTWInjShpF3QVg==","X-Google-Smtp-Source":"AOwi7QArtkZzKuLGdkp+rxWxQKwu5z1sR30XzMzm8xTlmr4qnxwSpEsYwaJqwiVU3Lvj8ir2zll3jCtJAjcaFTBi04s=","X-Received":"by 10.237.35.238 with SMTP id k43mr25166252qtc.214.1505276882655;\n\tTue, 12 Sep 2017 21:28:02 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<20170912204005.30404-1-robdclark@gmail.com>","References":"<20170912204005.30404-1-robdclark@gmail.com>","From":"Simon Glass <sjg@chromium.org>","Date":"Tue, 12 Sep 2017 22:27:41 -0600","X-Google-Sender-Auth":"N9BtdqFAUxigpP1Hi2AL5Cs_Kes","Message-ID":"<CAPnjgZ0-hirC_wiYmL77jxgd_=4_eGGN9K-d9dN5dVgOCyujaw@mail.gmail.com>","To":"Rob Clark <robdclark@gmail.com>","Cc":"U-Boot Mailing List <u-boot@lists.denx.de>","Subject":"Re: [U-Boot] [PATCH] fs/fat: fix fatbuf leak","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>"}},{"id":1767799,"web_url":"http://patchwork.ozlabs.org/comment/1767799/","msgid":"<9549cdb0-cba1-7c2c-8787-17bfb8d5573c@denx.de>","list_archive_url":null,"date":"2017-09-13T11:10:48","subject":"Re: [U-Boot] [PATCH] fs/fat: fix fatbuf leak","submitter":{"id":70701,"url":"http://patchwork.ozlabs.org/api/people/70701/","name":"Lukasz Majewski","email":"lukma@denx.de"},"content":"On 09/12/2017 10:40 PM, Rob Clark wrote:\n> A new fatbuf was allocated by get_fs_info() (called by fat_itr_root()),\n> but not freed, resulting in eventually running out of memory.  Spotted\n> by running 'ls -r' in a large FAT filesystem from Shell.efi.\n> \n> fatbuf is mainly used to cache FAT entry lookups (get_fatent())..\n> possibly once fat_write.c it can move into the iterator to simplify\n> this.\n> \n> Signed-off-by: Rob Clark <robdclark@gmail.com>\n> ---\n> I can squash this back in to the earlier readdir patches and resend\n> them if that is preferred.\n> \n>   fs/fat/fat.c | 23 ++++++++++++++++-------\n>   1 file changed, 16 insertions(+), 7 deletions(-)\n> \n> diff --git a/fs/fat/fat.c b/fs/fat/fat.c\n> index f5f74c12ff..f0284398b4 100644\n> --- a/fs/fat/fat.c\n> +++ b/fs/fat/fat.c\n> @@ -1042,6 +1042,7 @@ int fat_exists(const char *filename)\n>   \t\treturn 0;\n>   \n>   \tret = fat_itr_resolve(itr, filename, TYPE_ANY);\n> +\tfree(fsdata.fatbuf);\n>   \treturn ret == 0;\n>   }\n>   \n> @@ -1061,17 +1062,19 @@ int fat_size(const char *filename, loff_t *size)\n>   \t\t * Directories don't have size, but fs_size() is not\n>   \t\t * expected to fail if passed a directory path:\n>   \t\t */\n> +\t\tfree(fsdata.fatbuf);\n>   \t\tfat_itr_root(itr, &fsdata);\n>   \t\tif (!fat_itr_resolve(itr, filename, TYPE_DIR)) {\n>   \t\t\t*size = 0;\n> -\t\t\treturn 0;\n> +\t\t\tret = 0;\n>   \t\t}\n> -\t\treturn ret;\n> +\t\tgoto out;\n>   \t}\n>   \n>   \t*size = FAT2CPU32(itr->dent->size);\n> -\n> -\treturn 0;\n> +out:\n> +\tfree(fsdata.fatbuf);\n> +\treturn ret;\n>   }\n>   \n>   int file_fat_read_at(const char *filename, loff_t pos, void *buffer,\n> @@ -1087,10 +1090,14 @@ int file_fat_read_at(const char *filename, loff_t pos, void *buffer,\n>   \n>   \tret = fat_itr_resolve(itr, filename, TYPE_FILE);\n>   \tif (ret)\n> -\t\treturn ret;\n> +\t\tgoto out;\n>   \n>   \tprintf(\"reading %s\\n\", filename);\n> -\treturn get_contents(&fsdata, itr->dent, pos, buffer, maxsize, actread);\n> +\tret = get_contents(&fsdata, itr->dent, pos, buffer, maxsize, actread);\n> +\n> +out:\n> +\tfree(fsdata.fatbuf);\n> +\treturn ret;\n>   }\n>   \n>   int file_fat_read(const char *filename, void *buffer, int maxsize)\n> @@ -1126,7 +1133,7 @@ typedef struct {\n>   \n>   int fat_opendir(const char *filename, struct fs_dir_stream **dirsp)\n>   {\n> -\tfat_dir *dir = malloc(sizeof(*dir));\n> +\tfat_dir *dir = calloc(1, sizeof(*dir));\n>   \tint ret;\n>   \n>   \tif (!dir)\n> @@ -1144,6 +1151,7 @@ int fat_opendir(const char *filename, struct fs_dir_stream **dirsp)\n>   \treturn 0;\n>   \n>   fail:\n> +\tfree(dir->fsdata.fatbuf);\n>   \tfree(dir);\n>   \treturn ret;\n>   }\n> @@ -1174,6 +1182,7 @@ int fat_readdir(struct fs_dir_stream *dirs, struct fs_dirent **dentp)\n>   void fat_closedir(struct fs_dir_stream *dirs)\n>   {\n>   \tfat_dir *dir = (fat_dir *)dirs;\n> +\tfree(dir->fsdata.fatbuf);\n>   \tfree(dir);\n>   }\n>   \n> \nReviewed-by: Łukasz Majewski <lukma@denx.de>","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>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xsf9W3KDkz9sBW\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 21:11:10 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid CC83CC220D7; Wed, 13 Sep 2017 11:10:56 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id D9A19C21DAE;\n\tWed, 13 Sep 2017 11:10:53 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 8E8DFC21ED4; Wed, 13 Sep 2017 11:10:51 +0000 (UTC)","from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10])\n\tby lists.denx.de (Postfix) with ESMTPS id A832AC21D8C\n\tfor <u-boot@lists.denx.de>; Wed, 13 Sep 2017 11:10:50 +0000 (UTC)","from frontend03.mail.m-online.net (unknown [192.168.6.182])\n\tby mail-out.m-online.net (Postfix) with ESMTP id 3xsf960HNyz1qtF5;\n\tWed, 13 Sep 2017 13:10:50 +0200 (CEST)","from localhost (dynscan3.mnet-online.de [192.168.6.84])\n\tby mail.m-online.net (Postfix) with ESMTP id 3xsf956pT5z1qqks;\n\tWed, 13 Sep 2017 13:10:49 +0200 (CEST)","from mail.mnet-online.de ([192.168.8.182])\n\tby localhost (dynscan3.mail.m-online.net [192.168.6.84]) (amavisd-new,\n\tport 10024)\n\twith ESMTP id AnaRbXEeNLiW; Wed, 13 Sep 2017 13:10:49 +0200 (CEST)","from [192.168.2.222] (89-64-27-66.dynamic.chello.pl [89.64.27.66])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby mail.mnet-online.de (Postfix) with ESMTPSA;\n\tWed, 13 Sep 2017 13:10:48 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,\n\tRCVD_IN_MSPIKE_H3,\n\tRCVD_IN_MSPIKE_WL autolearn=unavailable autolearn_force=no\n\tversion=3.4.0","X-Virus-Scanned":"amavisd-new at mnet-online.de","X-Auth-Info":"E+OZMA1iBUmvAeEVXOt1lojab4N/fCnk5bSGS4ReHfg=","To":"Rob Clark <robdclark@gmail.com>,\n\tU-Boot Mailing List <u-boot@lists.denx.de>","References":"<20170912204005.30404-1-robdclark@gmail.com>","From":"=?utf-8?q?=C5=81ukasz_Majewski?= <lukma@denx.de>","Organization":"DENX","Message-ID":"<9549cdb0-cba1-7c2c-8787-17bfb8d5573c@denx.de>","Date":"Wed, 13 Sep 2017 13:10:48 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<20170912204005.30404-1-robdclark@gmail.com>","Content-Language":"en-US","Subject":"Re: [U-Boot] [PATCH] fs/fat: fix fatbuf leak","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-Transfer-Encoding":"base64","Content-Type":"text/plain; charset=\"utf-8\"; Format=\"flowed\"","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1767994,"web_url":"http://patchwork.ozlabs.org/comment/1767994/","msgid":"<20170913160112.GF25597@bill-the-cat>","list_archive_url":null,"date":"2017-09-13T16:01:12","subject":"Re: [U-Boot] [PATCH] fs/fat: fix fatbuf leak","submitter":{"id":65875,"url":"http://patchwork.ozlabs.org/api/people/65875/","name":"Tom Rini","email":"trini@konsulko.com"},"content":"On Tue, Sep 12, 2017 at 04:40:01PM -0400, Rob Clark wrote:\n\n> A new fatbuf was allocated by get_fs_info() (called by fat_itr_root()),\n> but not freed, resulting in eventually running out of memory.  Spotted\n> by running 'ls -r' in a large FAT filesystem from Shell.efi.\n> \n> fatbuf is mainly used to cache FAT entry lookups (get_fatent())..\n> possibly once fat_write.c it can move into the iterator to simplify\n> this.\n> \n> Signed-off-by: Rob Clark <robdclark@gmail.com>\n> ---\n> I can squash this back in to the earlier readdir patches and resend\n> them if that is preferred.\n\nSeparate is fine, thanks!","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\" (1024-bit key;\n\tunprotected) header.d=konsulko.com header.i=@konsulko.com\n\theader.b=\"ZQSq9cC8\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xsmnr7264z9sNV\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 02:09:36 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 94885C21EF4; Wed, 13 Sep 2017 16:06:44 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id B3C2DC2246E;\n\tWed, 13 Sep 2017 16:04:01 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid DFCD1C2223B; Wed, 13 Sep 2017 16:01:40 +0000 (UTC)","from mail-yw0-f182.google.com (mail-yw0-f182.google.com\n\t[209.85.161.182])\n\tby lists.denx.de (Postfix) with ESMTPS id 7327EC22466\n\tfor <u-boot@lists.denx.de>; Wed, 13 Sep 2017 16:01:27 +0000 (UTC)","by mail-yw0-f182.google.com with SMTP id v72so1535205ywa.3\n\tfor <u-boot@lists.denx.de>; Wed, 13 Sep 2017 09:01:27 -0700 (PDT)","from bill-the-cat ([2606:a000:140b:dc:1d69:83c5:25c8:1ebc])\n\tby smtp.gmail.com with ESMTPSA id\n\tg84sm4939439ywg.100.2017.09.13.09.01.13\n\t(version=TLS1_2 cipher=AES128-SHA bits=128/128);\n\tWed, 13 Sep 2017 09:01:13 -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=RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com;\n\ts=google; \n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=Y4uJqsSSZFVFjnnJ1S6EUTxCgZD/1Twa16KHGwf3xks=;\n\tb=ZQSq9cC8UZrPDf7i9q3tPNEnur4mTmZ/3ibUPk8vLu4gCrMnXjwuYfvnlg6v3GPRoC\n\tzNxP87WryBZ9rG2QzUc8m+QjetyKXtWEOyZ3JsE+Ob0wy4XXHM8ze7kyeLk78SflI+kn\n\t47UoPdaCxb/VW+l0i7fn2MKu8G1++uwVnRvA8=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=Y4uJqsSSZFVFjnnJ1S6EUTxCgZD/1Twa16KHGwf3xks=;\n\tb=HzDmsYBq8JYU0IVRKt2PqbZ8A0YgpX/Ron7oy31XZJKKOVsQRswLRMKLcJS7v8208l\n\tUkkcNwVNEzj3wq/FUQOKD0Lb1vlh7ne2zTeTtdHkN2eAaX+yE0nYzBdNnVZiIqKjL0wQ\n\tgZbL1uamnbKgv8c6NckFYtQEL9emK87g8/3n39DMUUHDXHu+F2VSA1fDpXZ7DEm1eO3T\n\ttblYSdb27iU7NcJzvnDIS58VhB9mnsbR1stQIioq+SGLzDaV/ZTOY9a+NiA6br8G1Tbf\n\tDsA+xaYiiQAN1DK6B1YvCDAJn2NwmY0PHp7f3PFvXcmeuIOY5VWQACR6PN64qmESPBYv\n\tU9Zg==","X-Gm-Message-State":"AHPjjUivXDa5hlwtDxpfX5CNippBWChLtbWk7x9lAAdAnc3o28HNIz5F\n\tmIXTdrSEFQAotjAc0Mo7yQ==","X-Google-Smtp-Source":"ADKCNb73TlosGgfKxIph4/M4dBWfK+dI6XhjDBVgItk8AiX0SJFZlWOMiA0HuUeIeXHFrEMzWsxuQA==","X-Received":"by 10.129.173.28 with SMTP id l28mr16296536ywh.95.1505318485832; \n\tWed, 13 Sep 2017 09:01:25 -0700 (PDT)","Date":"Wed, 13 Sep 2017 12:01:12 -0400","From":"Tom Rini <trini@konsulko.com>","To":"Rob Clark <robdclark@gmail.com>","Message-ID":"<20170913160112.GF25597@bill-the-cat>","References":"<20170912204005.30404-1-robdclark@gmail.com>","MIME-Version":"1.0","In-Reply-To":"<20170912204005.30404-1-robdclark@gmail.com>","User-Agent":"Mutt/1.5.21 (2010-09-15)","Cc":"U-Boot Mailing List <u-boot@lists.denx.de>","Subject":"Re: [U-Boot] [PATCH] fs/fat: fix fatbuf leak","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":"multipart/mixed;\n\tboundary=\"===============4236259048051612556==\"","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1769552,"web_url":"http://patchwork.ozlabs.org/comment/1769552/","msgid":"<20170916023239.GX4560@bill-the-cat>","list_archive_url":null,"date":"2017-09-16T02:32:39","subject":"Re: [U-Boot] fs/fat: fix fatbuf leak","submitter":{"id":65875,"url":"http://patchwork.ozlabs.org/api/people/65875/","name":"Tom Rini","email":"trini@konsulko.com"},"content":"On Tue, Sep 12, 2017 at 04:40:01PM -0400, Rob Clark wrote:\n\n> A new fatbuf was allocated by get_fs_info() (called by fat_itr_root()),\n> but not freed, resulting in eventually running out of memory.  Spotted\n> by running 'ls -r' in a large FAT filesystem from Shell.efi.\n> \n> fatbuf is mainly used to cache FAT entry lookups (get_fatent())..\n> possibly once fat_write.c it can move into the iterator to simplify\n> this.\n> \n> Signed-off-by: Rob Clark <robdclark@gmail.com>\n> Reviewed-by: Simon Glass <sjg@chromium.org>\n> Reviewed-by: Łukasz Majewski <lukma@denx.de>\n\nApplied to u-boot/master, thanks!","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\" (1024-bit key;\n\tunprotected) header.d=konsulko.com header.i=@konsulko.com\n\theader.b=\"tZTeh1Ix\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xvGjy4qrpz9sPk\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 16 Sep 2017 12:41:26 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 73796C21FC6; Sat, 16 Sep 2017 02:35:01 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 41EB3C21F77;\n\tSat, 16 Sep 2017 02:34:27 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 73BE7C21D8B; Sat, 16 Sep 2017 02:32:46 +0000 (UTC)","from mail-yw0-f178.google.com (mail-yw0-f178.google.com\n\t[209.85.161.178])\n\tby lists.denx.de (Postfix) with ESMTPS id AF5D9C21F22\n\tfor <u-boot@lists.denx.de>; Sat, 16 Sep 2017 02:32:42 +0000 (UTC)","by mail-yw0-f178.google.com with SMTP id s62so2436779ywg.0\n\tfor <u-boot@lists.denx.de>; Fri, 15 Sep 2017 19:32:42 -0700 (PDT)","from bill-the-cat (cpe-65-184-142-68.ec.res.rr.com.\n\t[65.184.142.68]) by smtp.gmail.com with ESMTPSA id\n\tg72sm894650ywe.26.2017.09.15.19.32.40\n\t(version=TLS1_2 cipher=AES128-SHA bits=128/128);\n\tFri, 15 Sep 2017 19:32:40 -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=RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com;\n\ts=google; \n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=XcBxWO7L641+hpmj6YmGup8Eid/4mRtOl4nS9H/2Sh8=;\n\tb=tZTeh1Ixm7GeiO3U5EMgKq1Xpf3blr5jVmvWErLWSJq7Ps44BjEcSxovWnXslKwqHQ\n\tjHo7b4OrqwsDfu2N5BF7N1nxyxleFUk2Js+MQua5v3ylNzCPnUbrMQf7QZzaVT/Qic78\n\tQO0hKqLkHUJKjQCBoPgDQXmHxqiVClfHpC/7s=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=XcBxWO7L641+hpmj6YmGup8Eid/4mRtOl4nS9H/2Sh8=;\n\tb=s0/AxO4ZGQ8VIkP2K9YREUVKwp0jwqR09/qo2NctIOFzWuC0nO2PCPrSaiz/Owq50u\n\t/ZKdhH7cKTLulUzQQwhYFa5NwVV1dxXQS1iN6qgQGXdJz4AY2xf5FlFUIhFpYNccnASE\n\tVfjyCe4/AZspJ49gObeaqtYDiCPwB0Ai8ccIXLfsD241OLO1T3X8PmOL3kraE4CpOwRo\n\tda22ECfeSAY0Ep1M5AJjz4fjXKWsvKnXEJL5nD2mrpSZUjI2iUNOYx5DxeMdkIa18kxC\n\tcEhaq1TCMfZ9xEG5GR83dj+qblzAuVy07c7XU8jUJEw6pTLfCA16Ft2+aXWJhor4LegJ\n\tsi8g==","X-Gm-Message-State":"AHPjjUiRlD0h4U4TN9b77ssFdYyKFPmOoVvdIc92upvMaVVfnDLOljxy\n\txctrPlv+QNqFKM7d","X-Google-Smtp-Source":"ADKCNb5qJh680o6nEqG0wVnRy6o30du3c4b8zBPS4dgza3HCx/IkzXn1w812ozHJ1xW4qM9jQYhXiw==","X-Received":"by 10.37.96.84 with SMTP id u81mr21647938ybb.218.1505529161561; \n\tFri, 15 Sep 2017 19:32:41 -0700 (PDT)","Date":"Fri, 15 Sep 2017 22:32:39 -0400","From":"Tom Rini <trini@konsulko.com>","To":"Rob Clark <robdclark@gmail.com>","Message-ID":"<20170916023239.GX4560@bill-the-cat>","References":"<20170912204005.30404-1-robdclark@gmail.com>","MIME-Version":"1.0","In-Reply-To":"<20170912204005.30404-1-robdclark@gmail.com>","User-Agent":"Mutt/1.5.21 (2010-09-15)","Cc":"U-Boot Mailing List <u-boot@lists.denx.de>","Subject":"Re: [U-Boot] fs/fat: fix fatbuf leak","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":"multipart/mixed;\n\tboundary=\"===============5763902685326430052==\"","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}}]