udf: Fix free space reporting for metadata and virtual partitions
Subsystems (2)
Jan Kara
reviewerPATCH 1/1 udf: Fix free space reporting for metadata and virtual partitions
Free space on filesystems with metadata or virtual partition maps currently gets misreported. This is because these partitions are just remapped onto underlying real partitions from which keep track of free blocks. Take this remapping into account when counting free blocks as well.
--- fs/udf/super.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)
I plan to take this patch to my tree.
fs/udf/super.c +14 -5
@@ -2492,17 +2492,26 @@ static unsigned int udf_count_free_table(struct super_block *sb,static unsigned int udf_count_free (struct super_block *sb) {unsigned int accum =0 ; -struct udf_sb_info *sbi; +struct udf_sb_info *sbi =UDF_SB (sb);struct udf_part_map *map; +unsigned int part = sbi->s_partition; +int ptype = sbi->s_partmaps[part].s_partition_type; + +if (ptype ==UDF_METADATA_MAP25 ) { + part = sbi->s_partmaps[part].s_type_specific.s_metadata. + s_phys_partition_ref; + }else if (ptype ==UDF_VIRTUAL_MAP15 || ptype ==UDF_VIRTUAL_MAP20 ) { + part =UDF_I (sbi->s_vat_inode)->i_location. + partitionReferenceNum; + } - sbi =UDF_SB (sb);if (sbi->s_lvid_bh) {struct logicalVolIntegrityDesc *lvid = (struct logicalVolIntegrityDesc *) sbi->s_lvid_bh->b_data; -if (le32_to_cpu (lvid->numOfPartitions) > sbi->s_partition) { +if (le32_to_cpu (lvid->numOfPartitions) > part) { accum =le32_to_cpu ( - lvid->freeSpaceTable[sbi->s_partition]); + lvid->freeSpaceTable[part]);if (accum ==0xFFFFFFFF ) accum =0 ; }
@@ -2511,7 +2520,7 @@ static unsigned int udf_count_free(struct super_block *sb)if (accum)return accum; - map = &sbi->s_partmaps[sbi->s_partition]; + map = &sbi->s_partmaps[part];if (map->s_partition_flags &UDF_PART_FLAG_UNALLOC_BITMAP ) { accum +=udf_count_free_bitmap (sb, map->s_uspace.s_bitmap);
Signature · 1 line
2.16.4
Quoted 24 lines · On Wednesday 08 January 2020 13:19:19 Jan Kara wrote:
Free space on filesystems with metadata or virtual partition maps currently gets misreported. This is because these partitions are just remapped onto underlying real partitions from which keep track of free blocks. Take this remapping into account when counting free blocks as well.
Reported-by Pali Rohár <[email protected]>Signed-off-by Jan Kara <[email protected]>--- fs/udf/super.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)I plan to take this patch to my tree.
fs/udf/super.c +1
-1@@ -2492,17 +2492,26 @@ static unsigned int udf_count_free_table(struct super_block *sb,static unsigned int udf_count_free (struct super_block *sb) {unsigned int accum =0 ; -struct udf_sb_info *sbi; +struct udf_sb_info *sbi =UDF_SB (sb);
fs/udf/super.c static unsigned int udf_count_free_table(struct super_block *sb, · line 2505
Quoted 10 lines
fs/udf/super.c +9
-0struct udf_part_map *map; +unsigned int part = sbi->s_partition; +int ptype = sbi->s_partmaps[part].s_partition_type; + +if (ptype ==UDF_METADATA_MAP25 ) { + part = sbi->s_partmaps[part].s_type_specific.s_metadata. + s_phys_partition_ref; + }else if (ptype ==UDF_VIRTUAL_MAP15 || ptype ==UDF_VIRTUAL_MAP20 ) { + part =UDF_I (sbi->s_vat_inode)->i_location. + partitionReferenceNum;
Hello! I do not think that it make sense to report "free blocks" for discs with Virtual partition. By definition of VAT, all blocks prior to VAT are already "read-only" and therefore these blocks cannot be use for writing new data by any implementation. And because VAT is stored on the last block, in our model all blocks are "occupied".
fs/udf/super.c static unsigned int udf_count_free_table(struct super_block *sb, · line 2514
Quoted 12 lines
fs/udf/super.c +3
-3+ } - sbi =UDF_SB (sb);if (sbi->s_lvid_bh) {struct logicalVolIntegrityDesc *lvid = (struct logicalVolIntegrityDesc *) sbi->s_lvid_bh->b_data; -if (le32_to_cpu (lvid->numOfPartitions) > sbi->s_partition) { +if (le32_to_cpu (lvid->numOfPartitions) > part) { accum =le32_to_cpu ( - lvid->freeSpaceTable[sbi->s_partition]); + lvid->freeSpaceTable[part]);
And in any case freeSpaceTable should not be used for discs with VAT. And we should ignore its value for discs with VAT.
UDF 2.60 2.2.6.2: Free Space Table values be maintained ... except ... for a virtual partition ...
And same applies for "partition with Access Type pseudo-overwritable".
Quoted 12 lines
fs/udf/super.c +1
-1if (accum ==0xFFFFFFFF ) accum =0 ; }@@ -2511,7 +2520,7 @@ static unsigned int udf_count_free(struct super_block *sb)if (accum)return accum; - map = &sbi->s_partmaps[sbi->s_partition]; + map = &sbi->s_partmaps[part];if (map->s_partition_flags &UDF_PART_FLAG_UNALLOC_BITMAP ) { accum +=udf_count_free_bitmap (sb, map->s_uspace.s_bitmap);
Signature · 2 lines
Pali Rohár [email protected]
Jan Kara
reviewerQuoted 33 lines · Pali Rohár
Quoted 32 lines · On Wednesday 08 January 2020 13:19:19 Jan Kara wrote:
Free space on filesystems with metadata or virtual partition maps currently gets misreported. This is because these partitions are just remapped onto underlying real partitions from which keep track of free blocks. Take this remapping into account when counting free blocks as well.
Reported-by Pali Rohár <[email protected]>Signed-off-by Jan Kara <[email protected]>--- fs/udf/super.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)I plan to take this patch to my tree.
fs/udf/super.c +8
-1@@ -2492,17 +2492,26 @@ static unsigned int udf_count_free_table(struct super_block *sb,static unsigned int udf_count_free (struct super_block *sb) {unsigned int accum =0 ; -struct udf_sb_info *sbi; +struct udf_sb_info *sbi =UDF_SB (sb);struct udf_part_map *map; +unsigned int part = sbi->s_partition; +int ptype = sbi->s_partmaps[part].s_partition_type; + +if (ptype ==UDF_METADATA_MAP25 ) { + part = sbi->s_partmaps[part].s_type_specific.s_metadata. + s_phys_partition_ref; + }else if (ptype ==UDF_VIRTUAL_MAP15 || ptype ==UDF_VIRTUAL_MAP20 ) {
Quoted 8 lines
fs/udf/super.c static unsigned int udf_count_free_table(struct super_block *sb, · line 2505
Quoted 2 lines
fs/udf/super.c +2
-0+ part =UDF_I (sbi->s_vat_inode)->i_location. + partitionReferenceNum;Hello! I do not think that it make sense to report "free blocks" for discs with Virtual partition. By definition of VAT, all blocks prior to VAT are already "read-only" and therefore these blocks cannot be use for writing new data by any implementation. And because VAT is stored on the last block, in our model all blocks are "occupied".
Fair enough. Let's just always return 0 for disks with VAT partition.
Quoted 16 lines
fs/udf/super.c static unsigned int udf_count_free_table(struct super_block *sb, · line 2514
Quoted 12 lines
fs/udf/super.c +3
-3+ } - sbi =UDF_SB (sb);if (sbi->s_lvid_bh) {struct logicalVolIntegrityDesc *lvid = (struct logicalVolIntegrityDesc *) sbi->s_lvid_bh->b_data; -if (le32_to_cpu (lvid->numOfPartitions) > sbi->s_partition) { +if (le32_to_cpu (lvid->numOfPartitions) > part) { accum =le32_to_cpu ( - lvid->freeSpaceTable[sbi->s_partition]); + lvid->freeSpaceTable[part]);And in any case freeSpaceTable should not be used for discs with VAT. And we should ignore its value for discs with VAT.
Quoted 4 lines
UDF 2.60 2.2.6.2: Free Space Table values be maintained ... except ... for a virtual partition ...
And same applies for "partition with Access Type pseudo-overwritable".
Well this is handled by the 'accum == 0xffffffff' condition below. So we effectively ignore these values.
Quoted 3 lines
fs/udf/super.c static unsigned int udf_count_free_table(struct super_block *sb, · line 2517
Quoted 3 lines
fs/udf/super.c +0
-0if (accum ==0xFFFFFFFF ) accum =0 ; }
Honza
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Quoted 61 lines · On Thursday 09 January 2020 13:44:05 Jan Kara wrote:
Quoted 33 lines · Pali Rohár
Quoted 32 lines · On Wednesday 08 January 2020 13:19:19 Jan Kara wrote:
Free space on filesystems with metadata or virtual partition maps currently gets misreported. This is because these partitions are just remapped onto underlying real partitions from which keep track of free blocks. Take this remapping into account when counting free blocks as well.
Reported-by Pali Rohár <[email protected]>Signed-off-by Jan Kara <[email protected]>--- fs/udf/super.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)I plan to take this patch to my tree.
fs/udf/super.c +8
-1@@ -2492,17 +2492,26 @@ static unsigned int udf_count_free_table(struct super_block *sb,static unsigned int udf_count_free (struct super_block *sb) {unsigned int accum =0 ; -struct udf_sb_info *sbi; +struct udf_sb_info *sbi =UDF_SB (sb);struct udf_part_map *map; +unsigned int part = sbi->s_partition; +int ptype = sbi->s_partmaps[part].s_partition_type; + +if (ptype ==UDF_METADATA_MAP25 ) { + part = sbi->s_partmaps[part].s_type_specific.s_metadata. + s_phys_partition_ref; + }else if (ptype ==UDF_VIRTUAL_MAP15 || ptype ==UDF_VIRTUAL_MAP20 ) {Quoted 8 lines
fs/udf/super.c static unsigned int udf_count_free_table(struct super_block *sb, · line 2505
Quoted 2 lines
fs/udf/super.c +2
-0+ part =UDF_I (sbi->s_vat_inode)->i_location. + partitionReferenceNum;Hello! I do not think that it make sense to report "free blocks" for discs with Virtual partition. By definition of VAT, all blocks prior to VAT are already "read-only" and therefore these blocks cannot be use for writing new data by any implementation. And because VAT is stored on the last block, in our model all blocks are "occupied".
Fair enough. Let's just always return 0 for disks with VAT partition.
Quoted 16 lines
fs/udf/super.c static unsigned int udf_count_free_table(struct super_block *sb, · line 2514
Quoted 12 lines
fs/udf/super.c +3
-3+ } - sbi =UDF_SB (sb);if (sbi->s_lvid_bh) {struct logicalVolIntegrityDesc *lvid = (struct logicalVolIntegrityDesc *) sbi->s_lvid_bh->b_data; -if (le32_to_cpu (lvid->numOfPartitions) > sbi->s_partition) { +if (le32_to_cpu (lvid->numOfPartitions) > part) { accum =le32_to_cpu ( - lvid->freeSpaceTable[sbi->s_partition]); + lvid->freeSpaceTable[part]);And in any case freeSpaceTable should not be used for discs with VAT. And we should ignore its value for discs with VAT.
Quoted 7 lines
Quoted 4 lines
UDF 2.60 2.2.6.2: Free Space Table values be maintained ... except ... for a virtual partition ...
And same applies for "partition with Access Type pseudo-overwritable".
Well this is handled by the 'accum ==
0xffffffff' condition below. So we effectively ignore these values.
Ok.
Quoted 5 lines
Quoted 3 lines
fs/udf/super.c static unsigned int udf_count_free_table(struct super_block *sb, · line 2517
Quoted 3 lines
fs/udf/super.c +0
-0if (accum ==0xFFFFFFFF ) accum =0 ; }Honza
Signature · 2 lines
Pali Rohár [email protected]
Quoted 65 lines · On Thursday 09 January 2020 13:56:57 Pali Rohár wrote:
Quoted 64 lines · On Thursday 09 January 2020 13:44:05 Jan Kara wrote:
Quoted 33 lines · Pali Rohár
Quoted 32 lines · On Wednesday 08 January 2020 13:19:19 Jan Kara wrote:
Free space on filesystems with metadata or virtual partition maps currently gets misreported. This is because these partitions are just remapped onto underlying real partitions from which keep track of free blocks. Take this remapping into account when counting free blocks as well.
Reported-by Pali Rohár <[email protected]>Signed-off-by Jan Kara <[email protected]>--- fs/udf/super.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)I plan to take this patch to my tree.
fs/udf/super.c +8
-1@@ -2492,17 +2492,26 @@ static unsigned int udf_count_free_table(struct super_block *sb,static unsigned int udf_count_free (struct super_block *sb) {unsigned int accum =0 ; -struct udf_sb_info *sbi; +struct udf_sb_info *sbi =UDF_SB (sb);struct udf_part_map *map; +unsigned int part = sbi->s_partition; +int ptype = sbi->s_partmaps[part].s_partition_type; + +if (ptype ==UDF_METADATA_MAP25 ) { + part = sbi->s_partmaps[part].s_type_specific.s_metadata. + s_phys_partition_ref; + }else if (ptype ==UDF_VIRTUAL_MAP15 || ptype ==UDF_VIRTUAL_MAP20 ) {Quoted 8 lines
fs/udf/super.c static unsigned int udf_count_free_table(struct super_block *sb, · line 2505
Quoted 2 lines
fs/udf/super.c +2
-0+ part =UDF_I (sbi->s_vat_inode)->i_location. + partitionReferenceNum;Hello! I do not think that it make sense to report "free blocks" for discs with Virtual partition. By definition of VAT, all blocks prior to VAT are already "read-only" and therefore these blocks cannot be use for writing new data by any implementation. And because VAT is stored on the last block, in our model all blocks are "occupied".
Fair enough. Let's just always return 0 for disks with VAT partition.
Quoted 19 lines
fs/udf/super.c static unsigned int udf_count_free_table(struct super_block *sb, · line 2514
Quoted 12 lines
fs/udf/super.c +3
-3+ } - sbi =UDF_SB (sb);if (sbi->s_lvid_bh) {struct logicalVolIntegrityDesc *lvid = (struct logicalVolIntegrityDesc *) sbi->s_lvid_bh->b_data; -if (le32_to_cpu (lvid->numOfPartitions) > sbi->s_partition) { +if (le32_to_cpu (lvid->numOfPartitions) > part) { accum =le32_to_cpu ( - lvid->freeSpaceTable[sbi->s_partition]); + lvid->freeSpaceTable[part]);And in any case freeSpaceTable should not be used for discs with VAT. And we should ignore its value for discs with VAT.
UDF 2.60 2.2.6.2: Free Space Table values be maintained ... except ... for a virtual partition ...
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
And same applies for "partition with Access Type pseudo-overwritable".
Well this is handled by the 'accum ==
0xffffffff' condition below. So we effectively ignore these values.Ok.
Now I'm thinking about another scenario: UDF allows you to have two partitions of Type1 (physical) on one volume: one with read-only access type and one with overwritable access type.
UDF 2.60 2.2.6.2 says: For a partition with Access Type read-only, the Free Space Table value shall be set to zero. And therefore we should ignore it.
But current implementation for discs without Metadata partition (all with UDF 2.01) reads free space table (only) from partition
unsigned int part = sbi->s_partition;
So is this s_partition one with read-only or overwritable access type?
And to make it more complicated, UDF 2.60 2.2.10 requires that such discs (with two partitions) needs to have also Metadata Partition Map.
Quoted 6 lines
Quoted 5 lines
Quoted 3 lines
fs/udf/super.c static unsigned int udf_count_free_table(struct super_block *sb, · line 2517
Quoted 3 lines
fs/udf/super.c +0
-0if (accum ==0xFFFFFFFF ) accum =0 ; }Honza
Signature · 2 lines
Pali Rohár [email protected]
Jan Kara
reviewerQuoted 73 lines · Pali Rohár
Quoted 65 lines · On Thursday 09 January 2020 13:56:57 Pali Rohár wrote:
Quoted 64 lines · On Thursday 09 January 2020 13:44:05 Jan Kara wrote:
Quoted 33 lines · Pali Rohár
Quoted 32 lines · On Wednesday 08 January 2020 13:19:19 Jan Kara wrote:
Free space on filesystems with metadata or virtual partition maps currently gets misreported. This is because these partitions are just remapped onto underlying real partitions from which keep track of free blocks. Take this remapping into account when counting free blocks as well.
Reported-by Pali Rohár <[email protected]>Signed-off-by Jan Kara <[email protected]>--- fs/udf/super.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)I plan to take this patch to my tree.
fs/udf/super.c +8
-1@@ -2492,17 +2492,26 @@ static unsigned int udf_count_free_table(struct super_block *sb,static unsigned int udf_count_free (struct super_block *sb) {unsigned int accum =0 ; -struct udf_sb_info *sbi; +struct udf_sb_info *sbi =UDF_SB (sb);struct udf_part_map *map; +unsigned int part = sbi->s_partition; +int ptype = sbi->s_partmaps[part].s_partition_type; + +if (ptype ==UDF_METADATA_MAP25 ) { + part = sbi->s_partmaps[part].s_type_specific.s_metadata. + s_phys_partition_ref; + }else if (ptype ==UDF_VIRTUAL_MAP15 || ptype ==UDF_VIRTUAL_MAP20 ) {Quoted 8 lines
fs/udf/super.c static unsigned int udf_count_free_table(struct super_block *sb, · line 2505
Quoted 2 lines
fs/udf/super.c +2
-0+ part =UDF_I (sbi->s_vat_inode)->i_location. + partitionReferenceNum;Hello! I do not think that it make sense to report "free blocks" for discs with Virtual partition. By definition of VAT, all blocks prior to VAT are already "read-only" and therefore these blocks cannot be use for writing new data by any implementation. And because VAT is stored on the last block, in our model all blocks are "occupied".
Fair enough. Let's just always return 0 for disks with VAT partition.
Quoted 19 lines
fs/udf/super.c static unsigned int udf_count_free_table(struct super_block *sb, · line 2514
Quoted 12 lines
fs/udf/super.c +3
-3+ } - sbi =UDF_SB (sb);if (sbi->s_lvid_bh) {struct logicalVolIntegrityDesc *lvid = (struct logicalVolIntegrityDesc *) sbi->s_lvid_bh->b_data; -if (le32_to_cpu (lvid->numOfPartitions) > sbi->s_partition) { +if (le32_to_cpu (lvid->numOfPartitions) > part) { accum =le32_to_cpu ( - lvid->freeSpaceTable[sbi->s_partition]); + lvid->freeSpaceTable[part]);And in any case freeSpaceTable should not be used for discs with VAT. And we should ignore its value for discs with VAT.
UDF 2.60 2.2.6.2: Free Space Table values be maintained ... except ... for a virtual partition ...
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
And same applies for "partition with Access Type pseudo-overwritable".
Well this is handled by the 'accum ==
0xffffffff' condition below. So we effectively ignore these values.Ok.
Quoted 7 lines
Now I'm thinking about another scenario: UDF allows you to have two partitions of Type1 (physical) on one volume: one with read-only access type and one with overwritable access type.
UDF 2.60 2.2.6.2 says: For a partition with Access Type read-only, the Free Space Table value shall be set to zero. And therefore we should ignore it.
That's what's going to happen (the code ends up ignoring values -1 and 0).
Quoted 6 lines
But current implementation for discs without Metadata partition (all with UDF 2.01) reads free space table (only) from partition
unsigned int part = sbi->s_partition;So is this
s_partitionone with read-only or overwritable access type?
Well, this is the partition we've got fileset from. I presume that's going to be on overwritable partition but who knows. Honestly, I have my doubts we'll handle disks with two Type1 partitions correctly since I never met such disks :) Do you have some disk image to try? :)
Quoted 2 lines
And to make it more complicated, UDF 2.60 2.2.10 requires that such discs (with two partitions) needs to have also Metadata Partition Map.
But in this case Metadata Partition Map is presumably over the overwritable partition so we should fine, shouldn't we?
Honza
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Quoted 78 lines · On Thursday 09 January 2020 17:53:24 Jan Kara wrote:
Quoted 77 lines · Pali Rohár
Quoted 65 lines · On Thursday 09 January 2020 13:56:57 Pali Rohár wrote:
Quoted 64 lines · On Thursday 09 January 2020 13:44:05 Jan Kara wrote:
Quoted 33 lines · Pali Rohár
Quoted 32 lines · On Wednesday 08 January 2020 13:19:19 Jan Kara wrote:
Free space on filesystems with metadata or virtual partition maps currently gets misreported. This is because these partitions are just remapped onto underlying real partitions from which keep track of free blocks. Take this remapping into account when counting free blocks as well.
Reported-by Pali Rohár <[email protected]>Signed-off-by Jan Kara <[email protected]>--- fs/udf/super.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)I plan to take this patch to my tree.
fs/udf/super.c +8
-1@@ -2492,17 +2492,26 @@ static unsigned int udf_count_free_table(struct super_block *sb,static unsigned int udf_count_free (struct super_block *sb) {unsigned int accum =0 ; -struct udf_sb_info *sbi; +struct udf_sb_info *sbi =UDF_SB (sb);struct udf_part_map *map; +unsigned int part = sbi->s_partition; +int ptype = sbi->s_partmaps[part].s_partition_type; + +if (ptype ==UDF_METADATA_MAP25 ) { + part = sbi->s_partmaps[part].s_type_specific.s_metadata. + s_phys_partition_ref; + }else if (ptype ==UDF_VIRTUAL_MAP15 || ptype ==UDF_VIRTUAL_MAP20 ) {Quoted 8 lines
fs/udf/super.c static unsigned int udf_count_free_table(struct super_block *sb, · line 2505
Quoted 2 lines
fs/udf/super.c +2
-0+ part =UDF_I (sbi->s_vat_inode)->i_location. + partitionReferenceNum;Hello! I do not think that it make sense to report "free blocks" for discs with Virtual partition. By definition of VAT, all blocks prior to VAT are already "read-only" and therefore these blocks cannot be use for writing new data by any implementation. And because VAT is stored on the last block, in our model all blocks are "occupied".
Fair enough. Let's just always return 0 for disks with VAT partition.
Quoted 19 lines
fs/udf/super.c static unsigned int udf_count_free_table(struct super_block *sb, · line 2514
Quoted 12 lines
fs/udf/super.c +3
-3+ } - sbi =UDF_SB (sb);if (sbi->s_lvid_bh) {struct logicalVolIntegrityDesc *lvid = (struct logicalVolIntegrityDesc *) sbi->s_lvid_bh->b_data; -if (le32_to_cpu (lvid->numOfPartitions) > sbi->s_partition) { +if (le32_to_cpu (lvid->numOfPartitions) > part) { accum =le32_to_cpu ( - lvid->freeSpaceTable[sbi->s_partition]); + lvid->freeSpaceTable[part]);And in any case freeSpaceTable should not be used for discs with VAT. And we should ignore its value for discs with VAT.
UDF 2.60 2.2.6.2: Free Space Table values be maintained ... except ... for a virtual partition ...
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
And same applies for "partition with Access Type pseudo-overwritable".
Well this is handled by the 'accum ==
0xffffffff' condition below. So we effectively ignore these values.Ok.
Now I'm thinking about another scenario: UDF allows you to have two partitions of Type1 (physical) on one volume: one with read-only access type and one with overwritable access type.
Quoted 5 lines
Quoted 3 lines
UDF 2.60 2.2.6.2 says: For a partition with Access Type read-only, the Free Space Table value shall be set to zero. And therefore we should ignore it.
That's what's going to happen (the code ends up ignoring values -1 and 0).
Ok, this could be enough.
Quoted 11 lines
Quoted 6 lines
But current implementation for discs without Metadata partition (all with UDF 2.01) reads free space table (only) from partition
unsigned int part = sbi->s_partition;So is this
s_partitionone with read-only or overwritable access type?Well, this is the partition we've got fileset from. I presume that's going to be on overwritable partition but who knows. Honestly, I have my doubts we'll handle disks with two Type1 partitions correctly since I never met such disks :) Do you have some disk image to try? :)
Seems that I do not have such disk image.
But if kernel does not support handling such disks then it does not make sense to do anything with this function which reports free blocks.
Quoted 5 lines
Quoted 2 lines
And to make it more complicated, UDF 2.60 2.2.10 requires that such discs (with two partitions) needs to have also Metadata Partition Map.
But in this case Metadata Partition Map is presumably over the overwritable partition so we should fine, shouldn't we?
In both cases I'm just speculating what may happen... Nothing against this patch.
Signature · 2 lines
Pali Rohár [email protected]