From nobody Tue Mar 07 10:11:22 2023 X-Original-To: freebsd-fs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PWB7412QKz3xBc6 for ; Tue, 7 Mar 2023 10:11:28 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PWB7402Wmz3LCh; Tue, 7 Mar 2023 10:11:28 +0000 (UTC) (envelope-from se@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678183888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vrVGLmYsnXJ79ND685r+/E6k02HLLkEsAaDALxu4XRE=; b=M9K3Rsg41CcpcI/5UK/l2/EXGIvg8q7gj4TJD4p4Wl5R8mc+yC3/s1EMj/wOZSZs93htKR syy6/cb5o4vcee3tHUYQkCHZ5cTorRZ5QidFurT9guc+b+tPzPS0nZnxkI4a8QjJRh3gIy 0VqP3/G+LIH3gLXKrVXQe3B2KJFqMWS6z0OtgVqm9u4OBE01ccNqiKsQKW0SeXFiFQVNjR ZAEpLSfd53QuXn6IqeDLIAd6Blb4TR6iEEDKE1i6EaoOUY7Jk+4xRCtvQCLZa+xeYMnDQo VqWk5id+LRywqlLFKrrZCAI0mJWB/65WOKpg3JiRuL4RmnbfcGCdRhnTBmFqBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678183888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vrVGLmYsnXJ79ND685r+/E6k02HLLkEsAaDALxu4XRE=; b=pKe2wDk4pUyKeI3n0CvJgAMjivaZHj7KBMZ4VLeEKjSy47ih4yWTKrzqemeIxA9GoPwkpJ CEd2jiD+omo9XqNQpW5jS3OY8ii6eOrRw0ESps7ARvBrW3ttChHdx8S6J4QQbFNgc4uIl+ hNlgQxl3ZC0poxTdoj7qKGj9zCwCsz05FpnQTOEpn9j+ww91kX+PFMJEOMKwTV1WzPDwOz 5WXfPzCmhbAjJ8w0vKYpzLmhlMbrofXfapuLj7Ixb6DGgtpauzv+mz4KI8S/+rqhCarB99 vyq7zKQdDB3ra+k6l4/lt1f/uDElXQpa8b2UUPQk/IgqCZ90FfYnPTStaYGYVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678183888; a=rsa-sha256; cv=none; b=HxCnj++ghFKv4wrWI1wYsIgv7g/atfrZ+EGJ1d4qd7x5FHeGndDmQirB8dSLeaeKrlRFZW PZ0pnBdrw0UCwzXO6WNaXIC9u2zpsFR4HiVTzLhBRx95ZM5nUzKss4uGx8qRg6eMw5aETf 1/TdP717SL5ZyiJXczT3fmWUDaNkd0kL6SIKgw4chBiaRJCRX92zOk0OUCMRe3jyAMXngf 5iirYVF6mkuZ+czu1RLCkCK/t+CQqKzlo6Cezi3iyf53JvHT1RuQgI1GB8Wl/AvedkR2NM ZZ6VpFHhsEb2bfoTu5Wl+7AbEU5qicmX4uIiJkx89HqRG/dy2Rsq1bhLX1YnyA== Received: from [IPV6:2003:cd:5f1a:a300:dccc:7df2:4021:6879] (p200300cd5f1aa300dccc7df240216879.dip0.t-ipconnect.de [IPv6:2003:cd:5f1a:a300:dccc:7df2:4021:6879]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4PWB7339nxzVw0; Tue, 7 Mar 2023 10:11:27 +0000 (UTC) (envelope-from se@FreeBSD.org) Message-ID: <5ecd7461-7dc7-5fa4-04fc-c76329a072f5@FreeBSD.org> Date: Tue, 7 Mar 2023 11:11:22 +0100 List-Id: Filesystems List-Archive: https://lists.freebsd.org/archives/freebsd-fs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-fs@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 From: Stefan Esser Subject: Re: FAT32 statfs(2) inode usage Content-Language: de-DE, en-US To: Ben Woods Cc: "freebsd-fs@freebsd.org" References: <504ffe37-524a-4218-82e6-93459ef4b528@app.fastmail.com> <09df4665-b43d-9b07-cd4c-def3fd5fdffd@FreeBSD.org> <73441506-5147-4098-abc7-524c9f2791d1@app.fastmail.com> In-Reply-To: <73441506-5147-4098-abc7-524c9f2791d1@app.fastmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N Am 06.03.23 um 13:43 schrieb Ben Woods: > I think my issue stems from the fact that the msdosfs_vfsops.c code is using the f_files limit variable to represent the FAT root directory entities limit, but is not using the corresponding f_ffree available variable to represent the current number of root directory entities. This leads to the df(1) output incorrectly implying that the number of root directory entities is at capacity. Yes, true ... This is the current code in msdosfs_statfs(): sbp->f_files = pmp->pm_RootDirEnts; /* XXX */ sbp->f_ffree = 0; /* what to put in here? */ The comment says it all ... > To avoid this confusion, I think the msdosfs_vfsops.c should either set both the f_files and f_ffree statfs variables so that df(1) correctly reports %iused, or should set them both to zero so that df(1) shows %iused as "-". > > Thoughts? I could implement a counter that provides a useful value for f_ffree by counting all file and directory creations and removals from the root directory of a FAT12/FAT16 file system. That would probably only take 1 hour of work for development and testing, but I'd want/need a review before committing to msdosfs. (I had stopped working on FreeBSD some 5 months ago because of frustration about the lack of response to many changes put up for review over the last few years, and have just got back to looking into the mail lists a few days ago. I used to spend >100 hours a month working on FreeBSD issues since joining the project in the 90s.) If you are interested in testing / review of the proposed change, I'll try to provide it ... Regards, STefan