linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali.rohar@gmail.com>
To: linux-fsdevel@vger.kernel.org, Jan Kara <jack@suse.com>
Subject: udf_count_free() and UDF discs with Metadata partition
Date: Thu, 26 Dec 2019 12:37:50 +0100	[thread overview]
Message-ID: <20191226113750.rcfmbs643sfnpixq@pali> (raw)

[-- Attachment #1: Type: text/plain, Size: 1263 bytes --]

Hello!

During testing of udfinfo tool (from udftools project) I found that
udfinfo's implementation for calculating free space does not work when
UDF filesystem has Metadata partition (according to OSTA UDF 2.50).

Year ago in udfinfo for calculating free space I used same algorithm as
is implemented in kernel UDF driver, function udf_count_free(). So I
suspect kernel driver could have it incorrectly implemented too, but I'm
not sure. So I'm sending this email to let you know about it.

What is the problem? UDF Metadata partition is stored directly on UDF
Physical partition and therefore free space calculation needs to be done
from Physical one (same applies for Virtual partition). But Metadata
partition contains mapping table for logical <--> physical blocks, so
reading data needs to be done always from Metadata partition. Also in
UDF terminology are two different things: Partition and Partition Map.
And "partition number" is a bit misleading as sometimes it refers to
"Partition" and sometimes to "Partition Map" what are two different
things.

Calculation problem in udfinfo I fixed in this commit:
https://github.com/pali/udftools/commit/1763c9f899bdbdb68b1a44a8cb5edd5141107043

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

             reply	other threads:[~2019-12-26 11:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-26 11:37 Pali Rohár [this message]
2020-01-07 14:45 ` udf_count_free() and UDF discs with Metadata partition Jan Kara
2020-01-07 15:01   ` Pali Rohár
2020-01-07 15:29     ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191226113750.rcfmbs643sfnpixq@pali \
    --to=pali.rohar@gmail.com \
    --cc=jack@suse.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).