From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 58D85C433EF for ; Thu, 14 Jul 2022 00:46:18 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DD76582068; Thu, 14 Jul 2022 02:46:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="sVemhR7l"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CEDB383FE5; Thu, 14 Jul 2022 02:46:13 +0200 (CEST) Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EDAE482068 for ; Thu, 14 Jul 2022 02:46:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pj1-x102f.google.com with SMTP id y14-20020a17090a644e00b001ef775f7118so6501535pjm.2 for ; Wed, 13 Jul 2022 17:46:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=ZmVdSRQwlrbhVSSlEEuYsHYuT+4B4f6a0CmCPmQafkc=; b=sVemhR7lA5m9U+MFjqDJiHb6UV6ympd6a6D6ZcCj9H9Ohj/sCXQmLnmEZQrt42x11M h5uFgbPZ9IOwCOj9luYqKZ2oWPjCHAQdcBtfcH+KJN0tDwRwTFWV4MsvcXTu2yWgCSFO QiV0z+nPxuy+h1+Sy511ii4WgrwYMz/h+vAR50k7EiFfIoqUA3tkSsf6GAQThUROyhpH OBtJIjrkfq3l3Ng+HKheRtN3ppjdUHoFkdMQ2PUNI/N9yaJYOOygrt8WaOyA6+IqTVh9 QVjfuU+hgT42vLAtg3MltJW8xXUIaKdbGww1w1nivzBymlgjFkYyt32LxpAKZzixouJf Ei2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=ZmVdSRQwlrbhVSSlEEuYsHYuT+4B4f6a0CmCPmQafkc=; b=GJART2PCfPX4NZihE83/ZWWFoIrDhA3Rw/B3YZYM1LdkTS9ZF4xlXfVOCnmbkMfX3m XjFpQRJCNDnXNHfKMJXPSS7U6JOHzx8hSTqnDxnwZtiV+6atBCy9+Mx50fIrVfU0tWo/ +WLWemTHU71shk/vwRWho211XDol/6vv6kDaB4IbHwsJinBb0CCSoWHPpml3MAUtF2aJ RnXKY4hhCIwZ/ZOjh2vCnxh4rI01h3EpIa5AU16FPgLJVo6WQqOuKqvHQ7EgYuzyEISm 0VzRFoaqVrG4CjEWPQ0uft9gHNtoTUuOQzOfjuQOLO3+CKlByaM/pIyzQVsdhlMnM2ms ibiQ== X-Gm-Message-State: AJIora/tIq0duQjEmxlO9cvHlmWarAgTQwu1zypnfn05fdFo3EEu4vtD 2MfqvkNG0ITE8bBKkIp+ZtDA7wFPnwB7RQ== X-Google-Smtp-Source: AGRyM1spF6u7OgdTYqbhW/XY+poNBjC3vVM5kMSCSFsaqoP4rY2qr+aE0UB0QO2GEcEdWl/SM4Paxw== X-Received: by 2002:a17:902:c405:b0:16c:3c8:d6e9 with SMTP id k5-20020a170902c40500b0016c03c8d6e9mr5558880plk.152.1657759569195; Wed, 13 Jul 2022 17:46:09 -0700 (PDT) Received: from laputa ([2400:4050:c3e1:100:c57c:842f:2db2:bf43]) by smtp.gmail.com with ESMTPSA id s13-20020a170902b18d00b0016bfb09be10sm19200plr.305.2022.07.13.17.46.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jul 2022 17:46:08 -0700 (PDT) Date: Thu, 14 Jul 2022 09:46:05 +0900 From: AKASHI Takahiro To: Heinrich Schuchardt Cc: Tom Rini , u-boot@lists.denx.de Subject: Re: [PATCH 0/3] fs/fat: fix handling of full disk Message-ID: <20220714004605.GC42596@laputa> Mail-Followup-To: AKASHI Takahiro , Heinrich Schuchardt , Tom Rini , u-boot@lists.denx.de References: <20220712223314.20530-1-xypron.glpk@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220712223314.20530-1-xypron.glpk@gmx.de> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On Tue, Jul 12, 2022 at 10:33:11PM +0000, Heinrich Schuchardt wrote: > Currently we have two functions with redundant coding to find an empty > cluster: > > * find_empty_cluster() seeks from the beginning of the FAT table > * determine_fatent() seeks after a given entry > > Both do not detect the end of the FAT table correctly and return an invalid > cluster number if no empty entry if found. > > Correctly determine empty FAT entries and full disk correctly. I hope that you add a test for this specific corner case. Thanks, -Takahiro Akashi > Carve out a function for creating directory entries to avoid code > duplication. > > Heinrich Schuchardt (3): > fs: fat: finding an empty FAT cluster > fs: fat: determine_fatent() error handling > fs: fat: carve out fat_create_dir_entry() > > fs/fat/fat_write.c | 161 ++++++++++++++++++++++----------------------- > 1 file changed, 79 insertions(+), 82 deletions(-) > > -- > 2.30.2 >