Skip to content

Commit fce2936

Browse files
geertuChris Mason
authored andcommitted
Btrfs: Do not truncate sector_t on 32-bit with CONFIG_LBDAF=y
sector_t may be either "u64" (always 64 bit) or "unsigned long" (32 or 64 bit). Casting it to "unsigned long" will truncate it on 32-bit platforms where CONFIG_LBDAF=y. Cast to "unsigned long long" and format using "ll" instead. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
1 parent 778746b commit fce2936

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

‎fs/btrfs/check-integrity.c‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2958,9 +2958,10 @@ int btrfsic_submit_bh(int rw, struct buffer_head *bh)
29582958
if (dev_state->state->print_mask &
29592959
BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH)
29602960
printk(KERN_INFO
2961-
"submit_bh(rw=0x%x, blocknr=%lu (bytenr %llu),"
2961+
"submit_bh(rw=0x%x, blocknr=%llu (bytenr %llu),"
29622962
" size=%lu, data=%p, bdev=%p)\n",
2963-
rw, (unsigned long)bh->b_blocknr, dev_bytenr,
2963+
rw, (unsigned long long)bh->b_blocknr,
2964+
dev_bytenr,
29642965
(unsigned long)bh->b_size, bh->b_data,
29652966
bh->b_bdev);
29662967
btrfsic_process_written_block(dev_state, dev_bytenr,
@@ -3027,9 +3028,10 @@ void btrfsic_submit_bio(int rw, struct bio *bio)
30273028
BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH)
30283029
printk(KERN_INFO
30293030
"submit_bio(rw=0x%x, bi_vcnt=%u,"
3030-
" bi_sector=%lu (bytenr %llu), bi_bdev=%p)\n",
3031-
rw, bio->bi_vcnt, (unsigned long)bio->bi_sector,
3032-
dev_bytenr, bio->bi_bdev);
3031+
" bi_sector=%llu (bytenr %llu), bi_bdev=%p)\n",
3032+
rw, bio->bi_vcnt,
3033+
(unsigned long long)bio->bi_sector, dev_bytenr,
3034+
bio->bi_bdev);
30333035

30343036
mapped_datav = kmalloc(sizeof(*mapped_datav) * bio->bi_vcnt,
30353037
GFP_NOFS);

0 commit comments

Comments
 (0)