linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] udf: Disallow R/W mode for disk with Metadata partition
@ 2020-01-12 14:49 Pali Rohár
  2020-01-13 11:40 ` Jan Kara
  0 siblings, 1 reply; 2+ messages in thread
From: Pali Rohár @ 2020-01-12 14:49 UTC (permalink / raw)
  To: linux-fsdevel, Jan Kara

Currently we do not support writing to UDF disks with Metadata partition.
There is already check that disks with declared minimal write revision to
UDF 2.50 or higher are mounted only in R/O mode but this does not cover
situation when minimal write revision is set incorrectly (e.g. to 2.01).

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
 fs/udf/super.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/udf/super.c b/fs/udf/super.c
index 8c28e93e9..3b7073c2f 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -1063,7 +1063,8 @@ static int check_partition_desc(struct super_block *sb,
 		goto force_ro;
 
 	if (map->s_partition_type == UDF_VIRTUAL_MAP15 ||
-	    map->s_partition_type == UDF_VIRTUAL_MAP20)
+	    map->s_partition_type == UDF_VIRTUAL_MAP20 ||
+	    map->s_partition_type == UDF_METADATA_MAP25)
 		goto force_ro;
 
 	return 0;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-13 11:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-12 14:49 [PATCH] udf: Disallow R/W mode for disk with Metadata partition Pali Rohár
2020-01-13 11:40 ` Jan Kara

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