linux-kernel.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: Roald Strauss <mr_lou@dewfall.dk>,
	"Steven J. Magnani" <steve.magnani@digidescorp.com>,
	Jan Kara <jack@suse.com>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: UDF filesystem image with Write-Once UDF Access Type
Date: Thu, 1 Aug 2019 09:35:30 +0200	[thread overview]
Message-ID: <20190801073530.GA25064@quack2.suse.cz> (raw)
In-Reply-To: <20190712100224.s2chparxszlbnill@pali>

Hello!

On Fri 12-07-19 12:02:24, Pali Rohár  wrote:
> I had discussion with Roald and based on his tests, Linux kernel udf.ko
> driver mounts UDF filesystem image with Write-Once UDF Access Type as
> normal read/write filesystem.
>
> I think this is a bug as Write-Once Access Type is defined that existing
> blocks on filesystem cannot be rewritten. Only new blocks can be
> appended after end of device. Basically it means special HW support from
> underlying media, e.g. for optical medias packet-writing technique (or
> ability to burn new session) and CDROM_LAST_WRITTEN ioctl to locate
> "current" end of device.
> 
> In my opinion without support for additional layer, kernel should treat
> UDF Write-Once Access Type as read-only mount for userspace. And not
> classic read/write mount.
> 
> If you want to play with Write-Once Access Type, use recent version of
> mkudffs and choose --media-type=cdr option, which generates UDF
> filesystem suitable for CD-R (Write-Once Access Type with VAT and other
> UDF options according to UDF specification).

Reasonably recent kernels should have this bug fixed and mount such fs read
only. That being said I've tested current upstream kernel with a media
created with --media-type=cdr and mounting failed with:

UDF-fs: error (device ubdb): udf_read_inode: (ino 524287) failed !bh
UDF-fs: error (device ubdb): udf_read_inode: (ino 524286) failed !bh
UDF-fs: error (device ubdb): udf_read_inode: (ino 524285) failed !bh
UDF-fs: error (device ubdb): udf_read_inode: (ino 524284) failed !bh
UDF-fs: Scanning with blocksize 2048 failed

So there's something fishy either in the created image or the kernel...
Didn't debug this further yet.

> Also in git master of udftools has mkduffs now new option --read-only
> which creates UDF image with Read-Only Access Type.

I've tested this and the kernel properly mounts the image read-only.

> It seems that udf.ko does not support updating VAT table, so probably it
> should treat also filesystem with VAT as read-only too.

This is definitely handled properly and we mount such fs read-only as well.

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

  parent reply	other threads:[~2019-08-01  7:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-12 10:02 Pali Rohár
2019-07-26 17:44 ` Steve Magnani
2019-08-01  7:44   ` Jan Kara
2019-08-01  7:35 ` Jan Kara [this message]
2019-08-01  8:38   ` Jan Kara
2019-08-01  8:57     ` Pali Rohár
2019-08-02 10:28       ` Jan Kara
2019-08-01  8:44   ` Pali Rohár
2019-08-01 10:21     ` Roald Strauss

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=20190801073530.GA25064@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=jack@suse.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mr_lou@dewfall.dk \
    --cc=pali.rohar@gmail.com \
    --cc=steve.magnani@digidescorp.com \
    --subject='Re: UDF filesystem image with Write-Once UDF Access Type' \
    /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

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).