17 Oct, 2017
1 commit
-
Fix problems noted in compilion with -Wformat=2 -Wformat-signedness.
In particular, a mismatch between the signedness of a value and the
signedness of its format specifier can result in unsigned values being
printed as negative numbers, e.g.:Partition (0 type 1511) starts at physical 460, block length -1779968542
...which occurs when mounting a large (> 1 TiB) UDF partition.
Changes since V1:
* Fixed additional issues noted in udf_bitmap_free_blocks(),
udf_get_fileident(), udf_show_options()Signed-off-by: Steven J. Magnani
Signed-off-by: Jan Kara
19 May, 2016
3 commits
-
UDF/OSTA terminology is confusing. Partition Numbers (PNs) are arbitrary
16-bit values, one for each physical partition in the volume. Partition
Reference Numbers (PRNs) are indices into the the Partition Map Table
and do not necessarily equal the PN of the mapped partition.The current metadata code mistakenly uses the PN instead of the PRN when
mapping metadata blocks to physical/sparable blocks. Windows-created
UDF 2.5 discs for some reason use large, arbitrary PNs, resulting in
mount failure and KASAN read warnings in udf_read_inode().For example, a NetBSD UDF 2.5 partition might look like this:
PRN PN Type
--- -- ----
0 0 Sparable
1 0 MetadataSince PRN == PN, we are fine.
But Windows could gives us:
PRN PN Type
--- ---- ----
0 8192 Sparable
1 8192 MetadataSo udf_read_inode() will start out by checking the partition length in
sbi->s_partmaps[8192], which is obviously out of bounds.Fix this by creating a new field (s_phys_partition_ref) in struct
udf_meta_data, referencing whatever physical or sparable map has the
same partition number as the metadata partition.[JK: Add comment about s_phys_partition_ref, change its name]
Signed-off-by: Alden Tondettar
Signed-off-by: Jan Kara -
Currently when udf_get_pblock_meta25() fails to map a block using the
primary metadata file, it will attempt to load the mirror file entry by
calling udf_find_metadata_inode_efe(). That function will return a ERR_PTR
if it fails, but the return value is only checked against NULL. Test the
return value using IS_ERR() and change it to NULL if needed.Signed-off-by: Alden Tondettar
Signed-off-by: Jan Kara -
Currently, if a metadata partition map is missing its partition descriptor,
then udf_get_pblock_meta25() will BUG() out the first time it is called.
This is rather drastic for a corrupted filesystem, so just treat this case
as an invalid mapping instead.Signed-off-by: Alden Tondettar
Signed-off-by: Jan Kara
14 Mar, 2015
1 commit
-
buffer_head.h was already included in udfdecl.h
Signed-off-by: Fabian Frederick
Signed-off-by: Jan Kara
01 Nov, 2011
3 commits
-
Use simple ->s_flags variable instead of u8 variable for each flag.
Signed-off-by: Jan Kara
-
It is not necessary to load mirror metadata FE when metadata FE is OK. So try
to read it only the first time udf_get_pblock_meta25() fails to map the block
from metadata FE.Signed-off-by: Ashish Sangwan
Signed-off-by: Namjae Jeon
Signed-off-by: Jan Kara -
Just whitespace and argument alignment.
Introduce some checkpatch warnings that deserve to be ignored.Reviewed-by: NamJae Jeon
Signed-off-by: Joe Perches
Signed-off-by: Jan Kara
11 Oct, 2011
1 commit
-
Rename udf_warning to udf_warn for consistency with normal logging
uses of pr_warn.Rename function udf_warning to _udf_warn.
Remove __func__ from uses and move __func__ to a new udf_warn
macro that calls _udf_warn.
Add \n's to uses of udf_warn, remove \n from _udf_warn.
Coalesce formats.Reviewed-by: NamJae Jeon
Signed-off-by: Joe Perches
Signed-off-by: Jan Kara
07 Jan, 2011
1 commit
-
This work was supported by a hardware donation from the CE Linux Forum.
Signed-off-by: Alessio Igor Bogani
Signed-off-by: Jan Kara