diff options
| author | Steve Magnani <steve.magnani@digidescorp.com> | 2017-10-12 09:48:41 -0400 |
|---|---|---|
| committer | Jan Kara <jack@suse.cz> | 2017-10-17 06:00:58 -0400 |
| commit | fcbf7637e6647e00de04d4b2e05ece2484bb3062 (patch) | |
| tree | 438535f802620428f7f42c6f44153b5fc5bfe29b | |
| parent | b490bdd630cc43a5725e76c7c23f8a7e55551145 (diff) | |
udf: Fix signed/unsigned format specifiers
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 <steve@digidescorp.com>
Signed-off-by: Jan Kara <jack@suse.cz>
| -rw-r--r-- | fs/udf/balloc.c | 12 | ||||
| -rw-r--r-- | fs/udf/directory.c | 2 | ||||
| -rw-r--r-- | fs/udf/inode.c | 16 | ||||
| -rw-r--r-- | fs/udf/misc.c | 4 | ||||
| -rw-r--r-- | fs/udf/namei.c | 4 | ||||
| -rw-r--r-- | fs/udf/partition.c | 6 | ||||
| -rw-r--r-- | fs/udf/super.c | 52 | ||||
| -rw-r--r-- | fs/udf/unicode.c | 2 |
8 files changed, 49 insertions, 49 deletions
diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c index cbfd6043274b..1b961b1d9699 100644 --- a/fs/udf/balloc.c +++ b/fs/udf/balloc.c | |||
| @@ -58,7 +58,7 @@ static int __load_block_bitmap(struct super_block *sb, | |||
| 58 | int nr_groups = bitmap->s_nr_groups; | 58 | int nr_groups = bitmap->s_nr_groups; |
| 59 | 59 | ||
| 60 | if (block_group >= nr_groups) { | 60 | if (block_group >= nr_groups) { |
| 61 | udf_debug("block_group (%d) > nr_groups (%d)\n", | 61 | udf_debug("block_group (%u) > nr_groups (%d)\n", |
| 62 | block_group, nr_groups); | 62 | block_group, nr_groups); |
| 63 | } | 63 | } |
| 64 | 64 | ||
| @@ -122,7 +122,7 @@ static void udf_bitmap_free_blocks(struct super_block *sb, | |||
| 122 | partmap = &sbi->s_partmaps[bloc->partitionReferenceNum]; | 122 | partmap = &sbi->s_partmaps[bloc->partitionReferenceNum]; |
| 123 | if (bloc->logicalBlockNum + count < count || | 123 | if (bloc->logicalBlockNum + count < count || |
| 124 | (bloc->logicalBlockNum + count) > partmap->s_partition_len) { | 124 | (bloc->logicalBlockNum + count) > partmap->s_partition_len) { |
| 125 | udf_debug("%d < %d || %d + %d > %d\n", | 125 | udf_debug("%u < %d || %u + %u > %u\n", |
| 126 | bloc->logicalBlockNum, 0, | 126 | bloc->logicalBlockNum, 0, |
| 127 | bloc->logicalBlockNum, count, | 127 | bloc->logicalBlockNum, count, |
| 128 | partmap->s_partition_len); | 128 | partmap->s_partition_len); |
| @@ -151,9 +151,9 @@ static void udf_bitmap_free_blocks(struct super_block *sb, | |||
| 151 | bh = bitmap->s_block_bitmap[bitmap_nr]; | 151 | bh = bitmap->s_block_bitmap[bitmap_nr]; |
| 152 | for (i = 0; i < count; i++) { | 152 | for (i = 0; i < count; i++) { |
| 153 | if (udf_set_bit(bit + i, bh->b_data)) { | 153 | if (udf_set_bit(bit + i, bh->b_data)) { |
| 154 | udf_debug("bit %ld already set\n", bit + i); | 154 | udf_debug("bit %lu already set\n", bit + i); |
| 155 | udf_debug("byte=%2x\n", | 155 | udf_debug("byte=%2x\n", |
| 156 | ((char *)bh->b_data)[(bit + i) >> 3]); | 156 | ((__u8 *)bh->b_data)[(bit + i) >> 3]); |
| 157 | } | 157 | } |
| 158 | } | 158 | } |
| 159 | udf_add_free_space(sb, sbi->s_partition, count); | 159 | udf_add_free_space(sb, sbi->s_partition, count); |
| @@ -364,7 +364,7 @@ static void udf_table_free_blocks(struct super_block *sb, | |||
| 364 | partmap = &sbi->s_partmaps[bloc->partitionReferenceNum]; | 364 | partmap = &sbi->s_partmaps[bloc->partitionReferenceNum]; |
| 365 | if (bloc->logicalBlockNum + count < count || | 365 | if (bloc->logicalBlockNum + count < count || |
| 366 | (bloc->logicalBlockNum + count) > partmap->s_partition_len) { | 366 | (bloc->logicalBlockNum + count) > partmap->s_partition_len) { |
| 367 | udf_debug("%d < %d || %d + %d > %d\n", | 367 | udf_debug("%u < %d || %u + %u > %u\n", |
| 368 | bloc->logicalBlockNum, 0, | 368 | bloc->logicalBlockNum, 0, |
| 369 | bloc->logicalBlockNum, count, | 369 | bloc->logicalBlockNum, count, |
| 370 | partmap->s_partition_len); | 370 | partmap->s_partition_len); |
| @@ -517,7 +517,7 @@ static int udf_table_prealloc_blocks(struct super_block *sb, | |||
| 517 | 517 | ||
| 518 | while (first_block != eloc.logicalBlockNum && | 518 | while (first_block != eloc.logicalBlockNum && |
| 519 | (etype = udf_next_aext(table, &epos, &eloc, &elen, 1)) != -1) { | 519 | (etype = udf_next_aext(table, &epos, &eloc, &elen, 1)) != -1) { |
| 520 | udf_debug("eloc=%d, elen=%d, first_block=%d\n", | 520 | udf_debug("eloc=%u, elen=%u, first_block=%u\n", |
| 521 | eloc.logicalBlockNum, elen, first_block); | 521 | eloc.logicalBlockNum, elen, first_block); |
| 522 | ; /* empty loop body */ | 522 | ; /* empty loop body */ |
| 523 | } | 523 | } |
diff --git a/fs/udf/directory.c b/fs/udf/directory.c index c41c3cc8e5c6..ebed5c60982e 100644 --- a/fs/udf/directory.c +++ b/fs/udf/directory.c | |||
| @@ -176,7 +176,7 @@ struct fileIdentDesc *udf_get_fileident(void *buffer, int bufsize, int *offset) | |||
| 176 | if (fi->descTag.tagIdent != cpu_to_le16(TAG_IDENT_FID)) { | 176 | if (fi->descTag.tagIdent != cpu_to_le16(TAG_IDENT_FID)) { |
| 177 | udf_debug("0x%x != TAG_IDENT_FID\n", | 177 | udf_debug("0x%x != TAG_IDENT_FID\n", |
| 178 | le16_to_cpu(fi->descTag.tagIdent)); | 178 | le16_to_cpu(fi->descTag.tagIdent)); |
| 179 | udf_debug("offset: %u sizeof: %lu bufsize: %u\n", | 179 | udf_debug("offset: %d sizeof: %lu bufsize: %d\n", |
| 180 | *offset, (unsigned long)sizeof(struct fileIdentDesc), | 180 | *offset, (unsigned long)sizeof(struct fileIdentDesc), |
| 181 | bufsize); | 181 | bufsize); |
| 182 | return NULL; | 182 | return NULL; |
diff --git a/fs/udf/inode.c b/fs/udf/inode.c index 1d8324a99e37..7d2a95c9d670 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c | |||
| @@ -1278,14 +1278,14 @@ static int udf_read_inode(struct inode *inode, bool hidden_inode) | |||
| 1278 | 1278 | ||
| 1279 | reread: | 1279 | reread: |
| 1280 | if (iloc->partitionReferenceNum >= sbi->s_partitions) { | 1280 | if (iloc->partitionReferenceNum >= sbi->s_partitions) { |
| 1281 | udf_debug("partition reference: %d > logical volume partitions: %d\n", | 1281 | udf_debug("partition reference: %u > logical volume partitions: %u\n", |
| 1282 | iloc->partitionReferenceNum, sbi->s_partitions); | 1282 | iloc->partitionReferenceNum, sbi->s_partitions); |
| 1283 | return -EIO; | 1283 | return -EIO; |
| 1284 | } | 1284 | } |
| 1285 | 1285 | ||
| 1286 | if (iloc->logicalBlockNum >= | 1286 | if (iloc->logicalBlockNum >= |
| 1287 | sbi->s_partmaps[iloc->partitionReferenceNum].s_partition_len) { | 1287 | sbi->s_partmaps[iloc->partitionReferenceNum].s_partition_len) { |
| 1288 | udf_debug("block=%d, partition=%d out of range\n", | 1288 | udf_debug("block=%u, partition=%u out of range\n", |
| 1289 | iloc->logicalBlockNum, iloc->partitionReferenceNum); | 1289 | iloc->logicalBlockNum, iloc->partitionReferenceNum); |
| 1290 | return -EIO; | 1290 | return -EIO; |
| 1291 | } | 1291 | } |
| @@ -1304,13 +1304,13 @@ reread: | |||
| 1304 | */ | 1304 | */ |
| 1305 | bh = udf_read_ptagged(inode->i_sb, iloc, 0, &ident); | 1305 | bh = udf_read_ptagged(inode->i_sb, iloc, 0, &ident); |
| 1306 | if (!bh) { | 1306 | if (!bh) { |
| 1307 | udf_err(inode->i_sb, "(ino %ld) failed !bh\n", inode->i_ino); | 1307 | udf_err(inode->i_sb, "(ino %lu) failed !bh\n", inode->i_ino); |
| 1308 | return -EIO; | 1308 | return -EIO; |
| 1309 | } | 1309 | } |
| 1310 | 1310 | ||
| 1311 | if (ident != TAG_IDENT_FE && ident != TAG_IDENT_EFE && | 1311 | if (ident != TAG_IDENT_FE && ident != TAG_IDENT_EFE && |
| 1312 | ident != TAG_IDENT_USE) { | 1312 | ident != TAG_IDENT_USE) { |
| 1313 | udf_err(inode->i_sb, "(ino %ld) failed ident=%d\n", | 1313 | udf_err(inode->i_sb, "(ino %lu) failed ident=%u\n", |
| 1314 | inode->i_ino, ident); | 1314 | inode->i_ino, ident); |
| 1315 | goto out; | 1315 | goto out; |
| 1316 | } | 1316 | } |
| @@ -1346,7 +1346,7 @@ reread: | |||
| 1346 | } | 1346 | } |
| 1347 | brelse(ibh); | 1347 | brelse(ibh); |
| 1348 | } else if (fe->icbTag.strategyType != cpu_to_le16(4)) { | 1348 | } else if (fe->icbTag.strategyType != cpu_to_le16(4)) { |
| 1349 | udf_err(inode->i_sb, "unsupported strategy type: %d\n", | 1349 | udf_err(inode->i_sb, "unsupported strategy type: %u\n", |
| 1350 | le16_to_cpu(fe->icbTag.strategyType)); | 1350 | le16_to_cpu(fe->icbTag.strategyType)); |
| 1351 | goto out; | 1351 | goto out; |
| 1352 | } | 1352 | } |
| @@ -1547,7 +1547,7 @@ reread: | |||
| 1547 | udf_debug("METADATA BITMAP FILE-----\n"); | 1547 | udf_debug("METADATA BITMAP FILE-----\n"); |
| 1548 | break; | 1548 | break; |
| 1549 | default: | 1549 | default: |
| 1550 | udf_err(inode->i_sb, "(ino %ld) failed unknown file type=%d\n", | 1550 | udf_err(inode->i_sb, "(ino %lu) failed unknown file type=%u\n", |
| 1551 | inode->i_ino, fe->icbTag.fileType); | 1551 | inode->i_ino, fe->icbTag.fileType); |
| 1552 | goto out; | 1552 | goto out; |
| 1553 | } | 1553 | } |
| @@ -2091,7 +2091,7 @@ int8_t udf_next_aext(struct inode *inode, struct extent_position *epos, | |||
| 2091 | block = udf_get_lb_pblock(inode->i_sb, &epos->block, 0); | 2091 | block = udf_get_lb_pblock(inode->i_sb, &epos->block, 0); |
| 2092 | epos->bh = udf_tread(inode->i_sb, block); | 2092 | epos->bh = udf_tread(inode->i_sb, block); |
| 2093 | if (!epos->bh) { | 2093 | if (!epos->bh) { |
| 2094 | udf_debug("reading block %d failed!\n", block); | 2094 | udf_debug("reading block %u failed!\n", block); |
| 2095 | return -1; | 2095 | return -1; |
| 2096 | } | 2096 | } |
| 2097 | } | 2097 | } |
| @@ -2146,7 +2146,7 @@ int8_t udf_current_aext(struct inode *inode, struct extent_position *epos, | |||
| 2146 | *elen = le32_to_cpu(lad->extLength) & UDF_EXTENT_LENGTH_MASK; | 2146 | *elen = le32_to_cpu(lad->extLength) & UDF_EXTENT_LENGTH_MASK; |
| 2147 | break; | 2147 | break; |
| 2148 | default: | 2148 | default: |
| 2149 | udf_debug("alloc_type = %d unsupported\n", iinfo->i_alloc_type); | 2149 | udf_debug("alloc_type = %u unsupported\n", iinfo->i_alloc_type); |
| 2150 | return -1; | 2150 | return -1; |
| 2151 | } | 2151 | } |
| 2152 | 2152 | ||
diff --git a/fs/udf/misc.c b/fs/udf/misc.c index 97f3258a7483..401e64cde1be 100644 --- a/fs/udf/misc.c +++ b/fs/udf/misc.c | |||
| @@ -209,7 +209,7 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block, | |||
| 209 | 209 | ||
| 210 | bh = udf_tread(sb, block); | 210 | bh = udf_tread(sb, block); |
| 211 | if (!bh) { | 211 | if (!bh) { |
| 212 | udf_err(sb, "read failed, block=%u, location=%d\n", | 212 | udf_err(sb, "read failed, block=%u, location=%u\n", |
| 213 | block, location); | 213 | block, location); |
| 214 | return NULL; | 214 | return NULL; |
| 215 | } | 215 | } |
| @@ -247,7 +247,7 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block, | |||
| 247 | le16_to_cpu(tag_p->descCRCLength))) | 247 | le16_to_cpu(tag_p->descCRCLength))) |
| 248 | return bh; | 248 | return bh; |
| 249 | 249 | ||
| 250 | udf_debug("Crc failure block %d: crc = %d, crclen = %d\n", block, | 250 | udf_debug("Crc failure block %u: crc = %u, crclen = %u\n", block, |
| 251 | le16_to_cpu(tag_p->descCRC), | 251 | le16_to_cpu(tag_p->descCRC), |
| 252 | le16_to_cpu(tag_p->descCRCLength)); | 252 | le16_to_cpu(tag_p->descCRCLength)); |
| 253 | error_out: | 253 | error_out: |
diff --git a/fs/udf/namei.c b/fs/udf/namei.c index d3f18a6fbe40..0458dd47e105 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c | |||
| @@ -840,7 +840,7 @@ static int udf_rmdir(struct inode *dir, struct dentry *dentry) | |||
| 840 | if (retval) | 840 | if (retval) |
| 841 | goto end_rmdir; | 841 | goto end_rmdir; |
| 842 | if (inode->i_nlink != 2) | 842 | if (inode->i_nlink != 2) |
| 843 | udf_warn(inode->i_sb, "empty directory has nlink != 2 (%d)\n", | 843 | udf_warn(inode->i_sb, "empty directory has nlink != 2 (%u)\n", |
| 844 | inode->i_nlink); | 844 | inode->i_nlink); |
| 845 | clear_nlink(inode); | 845 | clear_nlink(inode); |
| 846 | inode->i_size = 0; | 846 | inode->i_size = 0; |
| @@ -882,7 +882,7 @@ static int udf_unlink(struct inode *dir, struct dentry *dentry) | |||
| 882 | goto end_unlink; | 882 | goto end_unlink; |
| 883 | 883 | ||
| 884 | if (!inode->i_nlink) { | 884 | if (!inode->i_nlink) { |
| 885 | udf_debug("Deleting nonexistent file (%lu), %d\n", | 885 | udf_debug("Deleting nonexistent file (%lu), %u\n", |
| 886 | inode->i_ino, inode->i_nlink); | 886 | inode->i_ino, inode->i_nlink); |
| 887 | set_nlink(inode, 1); | 887 | set_nlink(inode, 1); |
| 888 | } | 888 | } |
diff --git a/fs/udf/partition.c b/fs/udf/partition.c index 888c364b2fe9..090baff83990 100644 --- a/fs/udf/partition.c +++ b/fs/udf/partition.c | |||
| @@ -32,7 +32,7 @@ uint32_t udf_get_pblock(struct super_block *sb, uint32_t block, | |||
| 32 | struct udf_sb_info *sbi = UDF_SB(sb); | 32 | struct udf_sb_info *sbi = UDF_SB(sb); |
| 33 | struct udf_part_map *map; | 33 | struct udf_part_map *map; |
| 34 | if (partition >= sbi->s_partitions) { | 34 | if (partition >= sbi->s_partitions) { |
| 35 | udf_debug("block=%d, partition=%d, offset=%d: invalid partition\n", | 35 | udf_debug("block=%u, partition=%u, offset=%u: invalid partition\n", |
| 36 | block, partition, offset); | 36 | block, partition, offset); |
| 37 | return 0xFFFFFFFF; | 37 | return 0xFFFFFFFF; |
| 38 | } | 38 | } |
| @@ -59,7 +59,7 @@ uint32_t udf_get_pblock_virt15(struct super_block *sb, uint32_t block, | |||
| 59 | vdata = &map->s_type_specific.s_virtual; | 59 | vdata = &map->s_type_specific.s_virtual; |
| 60 | 60 | ||
| 61 | if (block > vdata->s_num_entries) { | 61 | if (block > vdata->s_num_entries) { |
| 62 | udf_debug("Trying to access block beyond end of VAT (%d max %d)\n", | 62 | udf_debug("Trying to access block beyond end of VAT (%u max %u)\n", |
| 63 | block, vdata->s_num_entries); | 63 | block, vdata->s_num_entries); |
| 64 | return 0xFFFFFFFF; | 64 | return 0xFFFFFFFF; |
| 65 | } | 65 | } |
| @@ -83,7 +83,7 @@ uint32_t udf_get_pblock_virt15(struct super_block *sb, uint32_t block, | |||
| 83 | 83 | ||
| 84 | bh = sb_bread(sb, loc); | 84 | bh = sb_bread(sb, loc); |
| 85 | if (!bh) { | 85 | if (!bh) { |
| 86 | udf_debug("get_pblock(UDF_VIRTUAL_MAP:%p,%d,%d) VAT: %d[%d]\n", | 86 | udf_debug("get_pblock(UDF_VIRTUAL_MAP:%p,%u,%u) VAT: %u[%u]\n", |
| 87 | sb, block, partition, loc, index); | 87 | sb, block, partition, loc, index); |
| 88 | return 0xFFFFFFFF; | 88 | return 0xFFFFFFFF; |
| 89 | } | 89 | } |
diff --git a/fs/udf/super.c b/fs/udf/super.c index 7ea0592e7f7c..f80e0a0f24d3 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c | |||
| @@ -366,7 +366,7 @@ static int udf_show_options(struct seq_file *seq, struct dentry *root) | |||
| 366 | if (sbi->s_dmode != UDF_INVALID_MODE) | 366 | if (sbi->s_dmode != UDF_INVALID_MODE) |
| 367 | seq_printf(seq, ",dmode=%ho", sbi->s_dmode); | 367 | seq_printf(seq, ",dmode=%ho", sbi->s_dmode); |
| 368 | if (UDF_QUERY_FLAG(sb, UDF_FLAG_SESSION_SET)) | 368 | if (UDF_QUERY_FLAG(sb, UDF_FLAG_SESSION_SET)) |
| 369 | seq_printf(seq, ",session=%u", sbi->s_session); | 369 | seq_printf(seq, ",session=%d", sbi->s_session); |
| 370 | if (UDF_QUERY_FLAG(sb, UDF_FLAG_LASTBLOCK_SET)) | 370 | if (UDF_QUERY_FLAG(sb, UDF_FLAG_LASTBLOCK_SET)) |
| 371 | seq_printf(seq, ",lastblock=%u", sbi->s_last_block); | 371 | seq_printf(seq, ",lastblock=%u", sbi->s_last_block); |
| 372 | if (sbi->s_anchor != 0) | 372 | if (sbi->s_anchor != 0) |
| @@ -705,7 +705,7 @@ static loff_t udf_check_vsd(struct super_block *sb) | |||
| 705 | 705 | ||
| 706 | sector += (((loff_t)sbi->s_session) << sb->s_blocksize_bits); | 706 | sector += (((loff_t)sbi->s_session) << sb->s_blocksize_bits); |
| 707 | 707 | ||
| 708 | udf_debug("Starting at sector %u (%ld byte sectors)\n", | 708 | udf_debug("Starting at sector %u (%lu byte sectors)\n", |
| 709 | (unsigned int)(sector >> sb->s_blocksize_bits), | 709 | (unsigned int)(sector >> sb->s_blocksize_bits), |
| 710 | sb->s_blocksize); | 710 | sb->s_blocksize); |
| 711 | /* Process the sequence (if applicable). The hard limit on the sector | 711 | /* Process the sequence (if applicable). The hard limit on the sector |
| @@ -868,7 +868,7 @@ static int udf_find_fileset(struct super_block *sb, | |||
| 868 | 868 | ||
| 869 | if ((fileset->logicalBlockNum != 0xFFFFFFFF || | 869 | if ((fileset->logicalBlockNum != 0xFFFFFFFF || |
| 870 | fileset->partitionReferenceNum != 0xFFFF) && bh) { | 870 | fileset->partitionReferenceNum != 0xFFFF) && bh) { |
| 871 | udf_debug("Fileset at block=%d, partition=%d\n", | 871 | udf_debug("Fileset at block=%u, partition=%u\n", |
| 872 | fileset->logicalBlockNum, | 872 | fileset->logicalBlockNum, |
| 873 | fileset->partitionReferenceNum); | 873 | fileset->partitionReferenceNum); |
| 874 | 874 | ||
| @@ -981,14 +981,14 @@ static int udf_load_metadata_files(struct super_block *sb, int partition, | |||
| 981 | mdata->s_phys_partition_ref = type1_index; | 981 | mdata->s_phys_partition_ref = type1_index; |
| 982 | 982 | ||
| 983 | /* metadata address */ | 983 | /* metadata address */ |
| 984 | udf_debug("Metadata file location: block = %d part = %d\n", | 984 | udf_debug("Metadata file location: block = %u part = %u\n", |
| 985 | mdata->s_meta_file_loc, mdata->s_phys_partition_ref); | 985 | mdata->s_meta_file_loc, mdata->s_phys_partition_ref); |
| 986 | 986 | ||
| 987 | fe = udf_find_metadata_inode_efe(sb, mdata->s_meta_file_loc, | 987 | fe = udf_find_metadata_inode_efe(sb, mdata->s_meta_file_loc, |
| 988 | mdata->s_phys_partition_ref); | 988 | mdata->s_phys_partition_ref); |
| 989 | if (IS_ERR(fe)) { | 989 | if (IS_ERR(fe)) { |
| 990 | /* mirror file entry */ | 990 | /* mirror file entry */ |
| 991 | udf_debug("Mirror metadata file location: block = %d part = %d\n", | 991 | udf_debug("Mirror metadata file location: block = %u part = %u\n", |
| 992 | mdata->s_mirror_file_loc, mdata->s_phys_partition_ref); | 992 | mdata->s_mirror_file_loc, mdata->s_phys_partition_ref); |
| 993 | 993 | ||
| 994 | fe = udf_find_metadata_inode_efe(sb, mdata->s_mirror_file_loc, | 994 | fe = udf_find_metadata_inode_efe(sb, mdata->s_mirror_file_loc, |
| @@ -1012,7 +1012,7 @@ static int udf_load_metadata_files(struct super_block *sb, int partition, | |||
| 1012 | addr.logicalBlockNum = mdata->s_bitmap_file_loc; | 1012 | addr.logicalBlockNum = mdata->s_bitmap_file_loc; |
| 1013 | addr.partitionReferenceNum = mdata->s_phys_partition_ref; | 1013 | addr.partitionReferenceNum = mdata->s_phys_partition_ref; |
| 1014 | 1014 | ||
| 1015 | udf_debug("Bitmap file location: block = %d part = %d\n", | 1015 | udf_debug("Bitmap file location: block = %u part = %u\n", |
| 1016 | addr.logicalBlockNum, addr.partitionReferenceNum); | 1016 | addr.logicalBlockNum, addr.partitionReferenceNum); |
| 1017 | 1017 | ||
| 1018 | fe = udf_iget_special(sb, &addr); | 1018 | fe = udf_iget_special(sb, &addr); |
| @@ -1042,7 +1042,7 @@ static void udf_load_fileset(struct super_block *sb, struct buffer_head *bh, | |||
| 1042 | 1042 | ||
| 1043 | UDF_SB(sb)->s_serial_number = le16_to_cpu(fset->descTag.tagSerialNum); | 1043 | UDF_SB(sb)->s_serial_number = le16_to_cpu(fset->descTag.tagSerialNum); |
| 1044 | 1044 | ||
| 1045 | udf_debug("Rootdir at block=%d, partition=%d\n", | 1045 | udf_debug("Rootdir at block=%u, partition=%u\n", |
| 1046 | root->logicalBlockNum, root->partitionReferenceNum); | 1046 | root->logicalBlockNum, root->partitionReferenceNum); |
| 1047 | } | 1047 | } |
| 1048 | 1048 | ||
| @@ -1097,7 +1097,7 @@ static int udf_fill_partdesc_info(struct super_block *sb, | |||
| 1097 | if (p->accessType == cpu_to_le32(PD_ACCESS_TYPE_OVERWRITABLE)) | 1097 | if (p->accessType == cpu_to_le32(PD_ACCESS_TYPE_OVERWRITABLE)) |
| 1098 | map->s_partition_flags |= UDF_PART_FLAG_OVERWRITABLE; | 1098 | map->s_partition_flags |= UDF_PART_FLAG_OVERWRITABLE; |
| 1099 | 1099 | ||
| 1100 | udf_debug("Partition (%d type %x) starts at physical %d, block length %d\n", | 1100 | udf_debug("Partition (%d type %x) starts at physical %u, block length %u\n", |
| 1101 | p_index, map->s_partition_type, | 1101 | p_index, map->s_partition_type, |
| 1102 | map->s_partition_root, map->s_partition_len); | 1102 | map->s_partition_root, map->s_partition_len); |
| 1103 | 1103 | ||
| @@ -1122,7 +1122,7 @@ static int udf_fill_partdesc_info(struct super_block *sb, | |||
| 1122 | } | 1122 | } |
| 1123 | map->s_uspace.s_table = inode; | 1123 | map->s_uspace.s_table = inode; |
| 1124 | map->s_partition_flags |= UDF_PART_FLAG_UNALLOC_TABLE; | 1124 | map->s_partition_flags |= UDF_PART_FLAG_UNALLOC_TABLE; |
| 1125 | udf_debug("unallocSpaceTable (part %d) @ %ld\n", | 1125 | udf_debug("unallocSpaceTable (part %d) @ %lu\n", |
| 1126 | p_index, map->s_uspace.s_table->i_ino); | 1126 | p_index, map->s_uspace.s_table->i_ino); |
| 1127 | } | 1127 | } |
| 1128 | 1128 | ||
| @@ -1134,7 +1134,7 @@ static int udf_fill_partdesc_info(struct super_block *sb, | |||
| 1134 | bitmap->s_extPosition = le32_to_cpu( | 1134 | bitmap->s_extPosition = le32_to_cpu( |
| 1135 | phd->unallocSpaceBitmap.extPosition); | 1135 | phd->unallocSpaceBitmap.extPosition); |
| 1136 | map->s_partition_flags |= UDF_PART_FLAG_UNALLOC_BITMAP; | 1136 | map->s_partition_flags |= UDF_PART_FLAG_UNALLOC_BITMAP; |
| 1137 | udf_debug("unallocSpaceBitmap (part %d) @ %d\n", | 1137 | udf_debug("unallocSpaceBitmap (part %d) @ %u\n", |
| 1138 | p_index, bitmap->s_extPosition); | 1138 | p_index, bitmap->s_extPosition); |
| 1139 | } | 1139 | } |
| 1140 | 1140 | ||
| @@ -1157,7 +1157,7 @@ static int udf_fill_partdesc_info(struct super_block *sb, | |||
| 1157 | } | 1157 | } |
| 1158 | map->s_fspace.s_table = inode; | 1158 | map->s_fspace.s_table = inode; |
| 1159 | map->s_partition_flags |= UDF_PART_FLAG_FREED_TABLE; | 1159 | map->s_partition_flags |= UDF_PART_FLAG_FREED_TABLE; |
| 1160 | udf_debug("freedSpaceTable (part %d) @ %ld\n", | 1160 | udf_debug("freedSpaceTable (part %d) @ %lu\n", |
| 1161 | p_index, map->s_fspace.s_table->i_ino); | 1161 | p_index, map->s_fspace.s_table->i_ino); |
| 1162 | } | 1162 | } |
| 1163 | 1163 | ||
| @@ -1169,7 +1169,7 @@ static int udf_fill_partdesc_info(struct super_block *sb, | |||
| 1169 | bitmap->s_extPosition = le32_to_cpu( | 1169 | bitmap->s_extPosition = le32_to_cpu( |
| 1170 | phd->freedSpaceBitmap.extPosition); | 1170 | phd->freedSpaceBitmap.extPosition); |
| 1171 | map->s_partition_flags |= UDF_PART_FLAG_FREED_BITMAP; | 1171 | map->s_partition_flags |= UDF_PART_FLAG_FREED_BITMAP; |
| 1172 | udf_debug("freedSpaceBitmap (part %d) @ %d\n", | 1172 | udf_debug("freedSpaceBitmap (part %d) @ %u\n", |
| 1173 | p_index, bitmap->s_extPosition); | 1173 | p_index, bitmap->s_extPosition); |
| 1174 | } | 1174 | } |
| 1175 | return 0; | 1175 | return 0; |
| @@ -1282,7 +1282,7 @@ static int udf_load_partdesc(struct super_block *sb, sector_t block) | |||
| 1282 | /* First scan for TYPE1 and SPARABLE partitions */ | 1282 | /* First scan for TYPE1 and SPARABLE partitions */ |
| 1283 | for (i = 0; i < sbi->s_partitions; i++) { | 1283 | for (i = 0; i < sbi->s_partitions; i++) { |
| 1284 | map = &sbi->s_partmaps[i]; | 1284 | map = &sbi->s_partmaps[i]; |
| 1285 | udf_debug("Searching map: (%d == %d)\n", | 1285 | udf_debug("Searching map: (%u == %u)\n", |
| 1286 | map->s_partition_num, partitionNumber); | 1286 | map->s_partition_num, partitionNumber); |
| 1287 | if (map->s_partition_num == partitionNumber && | 1287 | if (map->s_partition_num == partitionNumber && |
| 1288 | (map->s_partition_type == UDF_TYPE1_MAP15 || | 1288 | (map->s_partition_type == UDF_TYPE1_MAP15 || |
| @@ -1291,7 +1291,7 @@ static int udf_load_partdesc(struct super_block *sb, sector_t block) | |||
| 1291 | } | 1291 | } |
| 1292 | 1292 | ||
| 1293 | if (i >= sbi->s_partitions) { | 1293 | if (i >= sbi->s_partitions) { |
| 1294 | udf_debug("Partition (%d) not found in partition map\n", | 1294 | udf_debug("Partition (%u) not found in partition map\n", |
| 1295 | partitionNumber); | 1295 | partitionNumber); |
| 1296 | ret = 0; | 1296 | ret = 0; |
| 1297 | goto out_bh; | 1297 | goto out_bh; |
| @@ -1483,7 +1483,7 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block, | |||
| 1483 | struct metadataPartitionMap *mdm = | 1483 | struct metadataPartitionMap *mdm = |
| 1484 | (struct metadataPartitionMap *) | 1484 | (struct metadataPartitionMap *) |
| 1485 | &(lvd->partitionMaps[offset]); | 1485 | &(lvd->partitionMaps[offset]); |
| 1486 | udf_debug("Parsing Logical vol part %d type %d id=%s\n", | 1486 | udf_debug("Parsing Logical vol part %d type %u id=%s\n", |
| 1487 | i, type, UDF_ID_METADATA); | 1487 | i, type, UDF_ID_METADATA); |
| 1488 | 1488 | ||
| 1489 | map->s_partition_type = UDF_METADATA_MAP25; | 1489 | map->s_partition_type = UDF_METADATA_MAP25; |
| @@ -1505,17 +1505,17 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block, | |||
| 1505 | udf_debug("Metadata Ident suffix=0x%x\n", | 1505 | udf_debug("Metadata Ident suffix=0x%x\n", |
| 1506 | le16_to_cpu(*(__le16 *) | 1506 | le16_to_cpu(*(__le16 *) |
| 1507 | mdm->partIdent.identSuffix)); | 1507 | mdm->partIdent.identSuffix)); |
| 1508 | udf_debug("Metadata part num=%d\n", | 1508 | udf_debug("Metadata part num=%u\n", |
| 1509 | le16_to_cpu(mdm->partitionNum)); | 1509 | le16_to_cpu(mdm->partitionNum)); |
| 1510 | udf_debug("Metadata part alloc unit size=%d\n", | 1510 | udf_debug("Metadata part alloc unit size=%u\n", |
| 1511 | le32_to_cpu(mdm->allocUnitSize)); | 1511 | le32_to_cpu(mdm->allocUnitSize)); |
| 1512 | udf_debug("Metadata file loc=%d\n", | 1512 | udf_debug("Metadata file loc=%u\n", |
| 1513 | le32_to_cpu(mdm->metadataFileLoc)); | 1513 | le32_to_cpu(mdm->metadataFileLoc)); |
| 1514 | udf_debug("Mirror file loc=%d\n", | 1514 | udf_debug("Mirror file loc=%u\n", |
| 1515 | le32_to_cpu(mdm->metadataMirrorFileLoc)); | 1515 | le32_to_cpu(mdm->metadataMirrorFileLoc)); |
| 1516 | udf_debug("Bitmap file loc=%d\n", | 1516 | udf_debug("Bitmap file loc=%u\n", |
| 1517 | le32_to_cpu(mdm->metadataBitmapFileLoc)); | 1517 | le32_to_cpu(mdm->metadataBitmapFileLoc)); |
| 1518 | udf_debug("Flags: %d %d\n", | 1518 | udf_debug("Flags: %d %u\n", |
| 1519 | mdata->s_flags, mdm->flags); | 1519 | mdata->s_flags, mdm->flags); |
| 1520 | } else { | 1520 | } else { |
| 1521 | udf_debug("Unknown ident: %s\n", | 1521 | udf_debug("Unknown ident: %s\n", |
| @@ -1525,7 +1525,7 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block, | |||
| 1525 | map->s_volumeseqnum = le16_to_cpu(upm2->volSeqNum); | 1525 | map->s_volumeseqnum = le16_to_cpu(upm2->volSeqNum); |
| 1526 | map->s_partition_num = le16_to_cpu(upm2->partitionNum); | 1526 | map->s_partition_num = le16_to_cpu(upm2->partitionNum); |
| 1527 | } | 1527 | } |
| 1528 | udf_debug("Partition (%d:%d) type %d on volume %d\n", | 1528 | udf_debug("Partition (%d:%u) type %u on volume %u\n", |
| 1529 | i, map->s_partition_num, type, map->s_volumeseqnum); | 1529 | i, map->s_partition_num, type, map->s_volumeseqnum); |
| 1530 | } | 1530 | } |
| 1531 | 1531 | ||
| @@ -1533,7 +1533,7 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block, | |||
| 1533 | struct long_ad *la = (struct long_ad *)&(lvd->logicalVolContentsUse[0]); | 1533 | struct long_ad *la = (struct long_ad *)&(lvd->logicalVolContentsUse[0]); |
| 1534 | 1534 | ||
| 1535 | *fileset = lelb_to_cpu(la->extLocation); | 1535 | *fileset = lelb_to_cpu(la->extLocation); |
| 1536 | udf_debug("FileSet found in LogicalVolDesc at block=%d, partition=%d\n", | 1536 | udf_debug("FileSet found in LogicalVolDesc at block=%u, partition=%u\n", |
| 1537 | fileset->logicalBlockNum, | 1537 | fileset->logicalBlockNum, |
| 1538 | fileset->partitionReferenceNum); | 1538 | fileset->partitionReferenceNum); |
| 1539 | } | 1539 | } |
| @@ -2159,7 +2159,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) | |||
| 2159 | ret = udf_load_vrs(sb, &uopt, silent, &fileset); | 2159 | ret = udf_load_vrs(sb, &uopt, silent, &fileset); |
| 2160 | if (ret < 0) { | 2160 | if (ret < 0) { |
| 2161 | if (!silent && ret != -EACCES) { | 2161 | if (!silent && ret != -EACCES) { |
| 2162 | pr_notice("Scanning with blocksize %d failed\n", | 2162 | pr_notice("Scanning with blocksize %u failed\n", |
| 2163 | uopt.blocksize); | 2163 | uopt.blocksize); |
| 2164 | } | 2164 | } |
| 2165 | brelse(sbi->s_lvid_bh); | 2165 | brelse(sbi->s_lvid_bh); |
| @@ -2184,7 +2184,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) | |||
| 2184 | goto error_out; | 2184 | goto error_out; |
| 2185 | } | 2185 | } |
| 2186 | 2186 | ||
| 2187 | udf_debug("Lastblock=%d\n", sbi->s_last_block); | 2187 | udf_debug("Lastblock=%u\n", sbi->s_last_block); |
| 2188 | 2188 | ||
| 2189 | if (sbi->s_lvid_bh) { | 2189 | if (sbi->s_lvid_bh) { |
| 2190 | struct logicalVolIntegrityDescImpUse *lvidiu = | 2190 | struct logicalVolIntegrityDescImpUse *lvidiu = |
| @@ -2255,7 +2255,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) | |||
| 2255 | /* perhaps it's not extensible enough, but for now ... */ | 2255 | /* perhaps it's not extensible enough, but for now ... */ |
| 2256 | inode = udf_iget(sb, &rootdir); | 2256 | inode = udf_iget(sb, &rootdir); |
| 2257 | if (IS_ERR(inode)) { | 2257 | if (IS_ERR(inode)) { |
| 2258 | udf_err(sb, "Error in udf_iget, block=%d, partition=%d\n", | 2258 | udf_err(sb, "Error in udf_iget, block=%u, partition=%u\n", |
| 2259 | rootdir.logicalBlockNum, rootdir.partitionReferenceNum); | 2259 | rootdir.logicalBlockNum, rootdir.partitionReferenceNum); |
| 2260 | ret = PTR_ERR(inode); | 2260 | ret = PTR_ERR(inode); |
| 2261 | goto error_out; | 2261 | goto error_out; |
diff --git a/fs/udf/unicode.c b/fs/udf/unicode.c index 695389a4fc23..f897e55f2cd0 100644 --- a/fs/udf/unicode.c +++ b/fs/udf/unicode.c | |||
| @@ -200,7 +200,7 @@ static int udf_name_from_CS0(uint8_t *str_o, int str_max_len, | |||
| 200 | cmp_id = ocu[0]; | 200 | cmp_id = ocu[0]; |
| 201 | if (cmp_id != 8 && cmp_id != 16) { | 201 | if (cmp_id != 8 && cmp_id != 16) { |
| 202 | memset(str_o, 0, str_max_len); | 202 | memset(str_o, 0, str_max_len); |
| 203 | pr_err("unknown compression code (%d)\n", cmp_id); | 203 | pr_err("unknown compression code (%u)\n", cmp_id); |
| 204 | return -EINVAL; | 204 | return -EINVAL; |
| 205 | } | 205 | } |
| 206 | u_ch = cmp_id >> 3; | 206 | u_ch = cmp_id >> 3; |
