From: Jan Kara <jack@suse.cz>
To: Kevin Weidemann <kwe-lnx@postn.eu>
Cc: "Jan Kara" <jack@suse.cz>,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
"Pali Rohár" <pali.rohar@gmail.com>
Subject: Re: udf: Prevent write-unsupported filesystem to be remounted read-write
Date: Tue, 22 Jan 2019 14:22:28 +0100 [thread overview]
Message-ID: <20190122132228.GF13149@quack2.suse.cz> (raw)
In-Reply-To: <20190114103011.GD13316@quack2.suse.cz>
Hello,
On Mon 14-01-19 11:30:11, Jan Kara wrote:
> On Mon 14-01-19 01:33:30, Kevin Weidemann wrote:
> > this is RE the patch 8515b9edf7a0c9dcf1ad218ccc783700db217336 (Upstream
> > commit a9ad01bc759df79b0012f43ee52164391e31cd96) in 4.18.20.
> >
> > I have an issue with UDF. I used to be able to create a UDF fs in a way
> > that is very similar to this:
> >
> > `# mkudffs --label=.... -m dvd -b 512 /dev/mapper/cryptdev1`
> >
> > I used to proceed mounting it, noticing it got mounted as readonly
> > (because the accesstype of the udf fs is readonly (as decided per -m
> > dvd)), so I remounted it as rw and then was able to fill it with data.[1]
> >
> > Now, this doesn't work anymore since the last time I did that. I figured
> > out it must have to do with the commit mentioned above. All I get now,
> > during a remount-as-rw attempt, is:
> > `cannot remount /dev/mapper/cryptdev1 read-write, is write-protected`.
> >
> > I am not sure if this counts as a regression, because I see the point in
> > not only auto-mounting such filesystems as readonly, but also preventing
> > remounting as rw, however it breaks my use case.
> >
> > However, I noticed the following, too:
> > case A) when having a "readonly udf" on a readwrite device, the
> > filesystem mounts as readonly (old behavior) and also prevents remounting
> > as rw (new behavior)
>
> This works as intended.
>
> > case B) when having a "readwrite udf" on a readonly device, the
> > filesystem mounts as readwrite (!), but the writes end up being invisibly
> > discarded
>
> That's a bug. I'll fix it. Thanks for reporting this!
I have checked this and it works for me as designed:
(none):~# mount -t udf /dev/ubdb /mnt
mount: block device /dev/ubdb is write-protected, mounting read-only
UDF-fs: warning (device ubdb): udf_load_vrs: No anchor found
UDF-fs: Scanning with blocksize 512 failed
UDF-fs: warning (device ubdb): udf_load_vrs: No anchor found
UDF-fs: Scanning with blocksize 1024 failed
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2017/01/20 10:17 (1000)
So if the block device is read-only, you will get only read only mount.
Also remount read-write gets prevented:
(none):~# mount -o remount,rw /mnt/
mount: block device /dev/ubdb is write-protected, mounting read-only
Or with more recent util-linux (2.31.1):
(none):/ # mount -t udf /dev/ubdb /mnt
UDF-fs: warning (device ubdb): udf_load_vrs: No anchor found
UDF-fs: Scanning with blocksize 512 failed
UDF-fs: warning (device ubdb): udf_load_vrs: No anchor found
UDF-fs: Scanning with blocksize 1024 failed
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2017/01/20 10:17 (1000)
mount: /mnt: WARNING: device write-protected, mounted read-only.
and remount:
(none):/ # mount -o remount,rw /mnt
mount: /mnt: cannot remount /dev/ubdb read-write, is write-protected.
The kernel is 5.0-rc3. What kernel were you testing with?
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2019-01-22 13:22 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <124cc6ea-ca79-20f2-651e-c2f909729ac0@gmx.de>
2019-01-14 0:33 ` udf: Prevent write-unsupported filesystem to be remounted read-write Kevin Weidemann
2019-01-14 10:30 ` Jan Kara
2019-01-14 12:00 ` Pali Rohár
2019-01-14 12:30 ` Jan Kara
2019-01-15 3:07 ` Michael Sabolish
2019-01-15 8:31 ` Pali Rohár
2019-01-15 8:41 ` Jan Kara
2019-01-15 8:48 ` Pali Rohár
2019-01-15 9:45 ` Jan Kara
2019-01-15 10:50 ` Pali Rohár
2019-01-15 11:15 ` Jan Kara
2019-01-14 15:12 ` Pali Rohár
2019-01-14 16:26 ` Kevin Weidemann
2019-01-22 13:22 ` Jan Kara [this message]
2019-01-23 20:29 ` Kevin Weidemann
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=20190122132228.GF13149@quack2.suse.cz \
--to=jack@suse.cz \
--cc=kwe-lnx@postn.eu \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@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