linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: "Pali Rohár" <pali.rohar@gmail.com>
Cc: linux-fsdevel@vger.kernel.org, Jan Kara <jack@suse.com>
Subject: Re: udf_count_free() and UDF discs with Metadata partition
Date: Tue, 7 Jan 2020 15:45:18 +0100	[thread overview]
Message-ID: <20200107144518.GF25547@quack2.suse.cz> (raw)
In-Reply-To: <20191226113750.rcfmbs643sfnpixq@pali>

Hello!

On Thu 26-12-19 12:37:50, Pali Rohár wrote:
> 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.

Thanks for the note! You're right that we probably misreport amount of free
space in the UDF filesystems with Metadata partition. Luckily the kernel
driver supports filesystems with Metadata partition or Virtual partition
only in read-only mode so the bug does not cause any real harm.

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

Thanks for the link, I'll fixup the kernel code. BTW, how did you test
this? Do you have any UDF image with Metadata partition?

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2020-01-07 14:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-26 11:37 udf_count_free() and UDF discs with Metadata partition Pali Rohár
2020-01-07 14:45 ` Jan Kara [this message]
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=20200107144518.GF25547@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=jack@suse.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=pali.rohar@gmail.com \
    /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).