From patchwork Fri Jul 20 02:57:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 142407 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2435049ljj; Thu, 19 Jul 2018 19:56:28 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf9ZB3uMpSG9ma9rMf07QNmilbudGGmswSuMqhEGnp5HUIzBao+LaG+A+DoU2uvtc2ITHI2 X-Received: by 2002:a50:ccdb:: with SMTP id b27-v6mr500103edj.98.1532055388313; Thu, 19 Jul 2018 19:56:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532055388; cv=none; d=google.com; s=arc-20160816; b=Sc+U4+VxhzqDukBEnVwcegD6vwnogjwQei2M++UTM7E4uTxYXdumjQdwJ9JW+Oq1dL dcSfG3hVssQnvadR5G51yGMHpK7PXmw7VPfTSJxsYyLoTM+1eC1ahDr9PUgTQZSg4JGa AeSbFLvvu0rJHbGOGUDTWyrpySmwEo1pzDh2i78WKCRtNDgFexYN+UeGNA9WBlFT+ENv Y1QUf8JwJHVZ1O9CLJU3xvU78CtCilfDpKV0fjmNMflKpxjYJ0UqjPHH7H4UCzJUC/jK rNTwK23epwVVBtk81WWxH1dR8P+cjnfglInrFo8QnP1ikf20ufO45vEtfC3Gsny/PSlP OzGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from :dkim-signature:arc-authentication-results; bh=osjgDq/lX8DimgBsopmY1lIoUIUOFEAcl1hc09j04b8=; b=aQCLz8+3W+FimuCjnZgd0Ml4OwTPM5lCw1N2Q1A6ZGtBJ3+bmpSJck7Xd3H8FQqQQv 8fiioBA5tPS2kB7F11N+nVDSxxi2gzPIpzOgRfbLTmQLMDN7G8yGNctXsF30P6cETLO6 si0rgACn/R1fFvqOGOWXqqC844GUDRHFxcx6jXil5Npv2JFXypBmolIwTEgFUZQBJVKM 2ds7rl2qPJpDQkgQfnrQMYF2Pv9gn7Z0iQA9G7GJWQY4WAgBqlqUF08ffkryv1f7o6ue vtYyRg+e6jy8DP5n47gxCfSOMdyepTQRl+Bv9ShBifzPdKfm6C53l0aNhsurEB+F3VmY DCIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=OsNYmW3a; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id r23-v6si883750edq.38.2018.07.19.19.56.27; Thu, 19 Jul 2018 19:56:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=OsNYmW3a; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 73B1DC21E29; Fri, 20 Jul 2018 02:56:25 +0000 (UTC) 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_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 3B669C21C4A; Fri, 20 Jul 2018 02:56:23 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 981D0C21C27; Fri, 20 Jul 2018 02:56:21 +0000 (UTC) Received: from mail-pl0-f68.google.com (mail-pl0-f68.google.com [209.85.160.68]) by lists.denx.de (Postfix) with ESMTPS id 85BF9C21BE5 for ; Fri, 20 Jul 2018 02:56:20 +0000 (UTC) Received: by mail-pl0-f68.google.com with SMTP id o7-v6so4504807plk.10 for ; Thu, 19 Jul 2018 19:56:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=ILUYe8W4XENNBIfeZWaQnAL+4joxAE2IVesUUc14fbQ=; b=OsNYmW3a3yUm7FFSOH/WCF4QUAOlqtejsHS8Xph/qeKTXGCxtb68NJoO07IPKg8Dxq l0M3SpasiCuu8yADljKBQQXkwjJ/vHG5bhFeUZLFp35lcxnKuaXOtZ8TTqkzcnr2TpKu wMkkFsyUoIcphqlwGL/sqXk4oUwIQeFJ1uTdg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ILUYe8W4XENNBIfeZWaQnAL+4joxAE2IVesUUc14fbQ=; b=ZgnatdWvQsn74RSQz+DtkUJLINK9c7wUqRXZ3otAciefFIpsmkUa4w3y9CujlA3pdw dQE/kAb9OJZgSDeFQPNM9MClAv6DRKqZML5w48q24Z1s4JEx9Rpf4G65xDKisiHm5jmT vB9CyNWMx33G8A3NvRlNQHDye/CY30valyq6VJCUViMkPK/+3iKuqFJRqq0kmm+xWBH2 4Gd1PihawTO/IaNwN6L91Oigz+SunNPc6QeqdK/yNLtih8EZG7mPFcUbmpouW/VP1wN5 rMtfM8WEDVp5rOLLWR4frBu6ZaS0qlhIvtfMSU4SfMhPaAi+P5I11j8lZrHbpufdeBaJ HEug== X-Gm-Message-State: AOUpUlG8JKc67CZkIbxwPZ+MSS2P/PL4E/bt+KaiOHuI9G/FXm7lWNSB N1CcrQIUOAqmw/DyV5maX0Vj3Q== X-Received: by 2002:a17:902:7d85:: with SMTP id a5-v6mr302711plm.202.1532055379037; Thu, 19 Jul 2018 19:56:19 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id b73-v6sm706106pfl.152.2018.07.19.19.56.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jul 2018 19:56:17 -0700 (PDT) From: AKASHI Takahiro To: trini@konsulko.com Date: Fri, 20 Jul 2018 11:57:06 +0900 Message-Id: <20180720025723.6736-1-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.17.0 Cc: u-boot@lists.denx.de, xypron.glpk@gmx.de, agraf@suse.de Subject: [U-Boot] [PATCH 00/17] fs: fat: extend FAT write operations X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This patch series is an attempt to address FAT write related issues in an effort of running UEFI SCT (Self-Certification Test) to verify UEFI support on u-boot. SCT is a test platform as well as an extentisive collection of test cases for UEFI specification. It can run all the tests automatically and save test results to dedicated log files. AFAIK, what's missing in the current fat file system to safely run SCT without errors (I don't mean test case failures) are: * write a file located under sub-directories * write a file with non-zero offset * delete a file * create a directory Patch#1 to patch#6 are some sort of preparatory ones. Patch#7 implements write with sub-directories path. Patch#8 to patch#10 implement write with non-zero offset. Patch#11 to patch#15 are related to creating a directory. Patch#16 provides delete, but it doesn't actually delete a file but instead return 0 with purging a file content, which is good enough to run SCT for now. Finally, patch#17 fixes a minor bug in fs-test.sh. I applied this patch set on top of v2018.07 along with a couple of yet-to--be-upstreamed UEFI-related patches, and could successfully run unmodified SCT[1] on qemu-arm. [1] http://uefi.org/testtools AKASHI Takahiro (17): fs: fat: extend get_fs_info() for write use fs: fat: handle "." and ".." of root dir correctly with fat_itr_resolve() fs: fat: make directory iterator global for write use fs: fat: assure iterator's ->dent belongs to ->clust fs: fat: check and normailze file name fs: fat: write returns error code instead of -1 fs: fat: support write with sub-directory path fs: fat: refactor write interface for a file offset fs: fat: support write with non-zero offset cmd: fat: add offset parameter to fatwrite fs: add mkdir interface fs: fat: remember the starting cluster number of directory fs: fat: support mkdir cmd: fat: add fatmkdir command efi_loader: file: support creating a directory efi_loader: implement a pseudo "file delete" fs-test: fix false positive error at Test Case 12 cmd/fat.c | 22 +- fs/fat/fat.c | 98 ++-- fs/fat/fat_write.c | 1051 +++++++++++++++++++++++-------------- fs/fs.c | 46 ++ include/fat.h | 37 ++ include/fs.h | 10 + lib/efi_loader/efi_file.c | 24 +- test/fs/fs-test.sh | 2 +- 8 files changed, 825 insertions(+), 465 deletions(-)