Received: by 2002:a05:6500:1b8a:b0:1ef:a0f1:aef6 with SMTP id df10csp130929lqb; Sun, 10 Mar 2024 07:59:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU3kdodoZWv4UKneqorFkCXQGxkkdvwKZXinXqWk+BTIIIKX/cl0F0+KNPNAbwCerzJldGeEBIKRsrdVKe4fGp77IeRgBo86j87ZGXcXw== X-Google-Smtp-Source: AGHT+IGF+AR1kJ8Iy4tqWR7hvyv139ELUkd3OpdlkgxMT5w5UFDXTXfdM1yrb5AVWZ8xngj7HGvN X-Received: by 2002:a17:903:25c1:b0:1dd:779d:dd4a with SMTP id jc1-20020a17090325c100b001dd779ddd4amr4395069plb.63.1710082790169; Sun, 10 Mar 2024 07:59:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710082790; cv=pass; d=google.com; s=arc-20160816; b=K9b22Juu+jjGGjFSvcJLt5Xc+GsAlfa2tOJW55OxDEmT9Gmsxvu0smyuf0c6t0Kcl+ YbzVvDj7EYCi6BhvZpnoDqeJr/jfHQDocuE2ov85jQ9Izs2hnK6wUUli4UU+wqK9X01q LwB3Fcb7614wAMyuyq2plOLVC7THVngztOwLyqwP0FX5IusFvsQTNaj5FkDZ9/hXMJma H9jE4jL8FR91JBs/D/TH2FeDDXko3yYsK2EDhWJo6FGdF024h/XStHhlHPczORwzXOBG APmY9S5+QH8fXNwOFxkDlzIBjxFjjoxzSOJBNbwZJdyWbM5CMOtjXk2LrTovzn4jJJtl FBlQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:date:references:in-reply-to:subject:cc:to :from; bh=2LvH159uC59CTwyRoKmjQGcFY7JmtU7/m/WYkSoC1Wk=; fh=8fMNz5XLes1q6KgZpQVNR7IFjb0t+7u9G1PE29ucuLE=; b=UBO4fVKJUQoWEli703Y79O83d8cFzN7dYceWDL8ups3PUto+YhYYR/9pA+KGNXGg90 Eb8hUf2voZtr0xuqZEQw8o5VRasDquXSG5taME3p1hq0bVijYgDztJm9cyE/SVMgizEG Kw7kdxqOXWMkT3J306BuzbYVOALEjjyExkcDARays2mnR3EOlkBg9b4vdpeOGqLqSdKm DNyx8CUpizdEh29BOsNQUCXiIsjd5jDSSh5IpXHL7Os1AQeeuI+znP0PNNLfIKGXqzg7 gOqbiJgQnIYHVi7b5DD0oe1ctIAhwGEPAOiyyHvuRIxGbNPVZelJ7KwRRdy9XJWT/VoE Z2Ow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=parknet.co.jp); spf=pass (google.com: domain of linux-kernel+bounces-98248-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98248-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id b7-20020a170902650700b001d78a87de63si3034509plk.205.2024.03.10.07.59.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Mar 2024 07:59:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-98248-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=parknet.co.jp); spf=pass (google.com: domain of linux-kernel+bounces-98248-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98248-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 6A92C282217 for ; Sun, 10 Mar 2024 14:59:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 236C03770D; Sun, 10 Mar 2024 14:59:42 +0000 (UTC) Received: from mail.parknet.co.jp (mail.parknet.co.jp [210.171.160.6]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6967E10EB; Sun, 10 Mar 2024 14:59:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.171.160.6 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710082781; cv=none; b=PdBKr3zeGvyEv9z+GHi2FqaPEeAv56ly5iLGZ7QoLZp8ICvW/1TMQu6DwvJxXx5Muo1G3P7CIbgDbEF1biJUzAAu+sOSjiwAhY9l2S3AFZNSich3g+RPYEhL8VvkwRTwFD1p98xcTBomqQMTLW41u0zdTdPwMG7kcQUaoLX77/A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710082781; c=relaxed/simple; bh=5ch0BcEoY4QFgsjAL51akk8/crXIPVwzpgp1vVyzJCY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=T7RILc/dam3fT+uYMudzs5XmsdOW8eFt78gU9+fGUSClcvibrL76zXE9lWgJmNU1iIBlaWtONrIyFP7bv75Ojsx64sSLAvix4d1wv0UpNL8VnVrj87212wIiuKUYGHz8KXSoBTXDfiWXjQpUK9x5Ej7L0ne+OnWoeuUiMt+IOJI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mail.parknet.co.jp; spf=pass smtp.mailfrom=parknet.co.jp; arc=none smtp.client-ip=210.171.160.6 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mail.parknet.co.jp Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=parknet.co.jp Received: from ibmpc.myhome.or.jp (server.parknet.ne.jp [210.171.168.39]) by mail.parknet.co.jp (Postfix) with ESMTPSA id E3B61205DB9A; Sun, 10 Mar 2024 23:59:36 +0900 (JST) Received: from devron.myhome.or.jp (foobar@devron.myhome.or.jp [192.168.0.3]) by ibmpc.myhome.or.jp (8.18.1/8.18.1/Debian-1) with ESMTPS id 42AExZDr143133 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sun, 10 Mar 2024 23:59:36 +0900 Received: from devron.myhome.or.jp (foobar@localhost [127.0.0.1]) by devron.myhome.or.jp (8.18.1/8.18.1/Debian-1) with ESMTPS id 42AExZkw775659 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sun, 10 Mar 2024 23:59:35 +0900 Received: (from hirofumi@localhost) by devron.myhome.or.jp (8.18.1/8.18.1/Submit) id 42AExYfT775658; Sun, 10 Mar 2024 23:59:34 +0900 From: OGAWA Hirofumi To: Thadeu Lima de Souza Cascardo Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Gwendal Grignou , dlunev@chromium.org Subject: Re: [PATCH] fat: ignore .. subdir and always add a link to dirs In-Reply-To: (Thadeu Lima de Souza Cascardo's message of "Sun, 10 Mar 2024 07:14:26 -0300") References: <87bk88oskz.fsf@mail.parknet.co.jp> <874jdzpov7.fsf@mail.parknet.co.jp> <87zfvroa1c.fsf@mail.parknet.co.jp> <87v86fnz2o.fsf@mail.parknet.co.jp> <87le75s1fg.fsf@mail.parknet.co.jp> <87h6hek50l.fsf@mail.parknet.co.jp> Date: Sun, 10 Mar 2024 23:59:34 +0900 Message-ID: <87cys2jfop.fsf@mail.parknet.co.jp> User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Thadeu Lima de Souza Cascardo writes: >> If we really want to accept this image, we have to change the fat driver >> without affecting good image. And your patch affects to good image, >> because that patch doesn't count directory correctly, so bad link count. >> > > Well, it does behave the same on a correct image. It ignores the existence of > ".." when counting subdirs, but always adds an extra link count. > > So, images that have both "." and ".." subdirs, will have the 2 links, both > with the patch and without the patch. You are forgetting to count about normal dirs other than "." and ".."? Thanks. > Images with neither dirs will be rejected before the patch and have a link > count of 1 after the patch. Still, creating and removing subdirs will work. > Removing the bad dir itself also works. > > Images with only "." or only ".." would have a link count of 1 and be rejected > without the patch. > > With the patch, directories with only ".." should behave the same as if they > had neither subdirs. That is, link count of 1. And directories with only "." > will have a link count of 2. -- OGAWA Hirofumi