Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-udf-2.6

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-udf-2.6:
udf: remove redundant tests on unsigned
udf: Use device size when drive reported bogus number of written blocks

+10 -6
+4 -5
fs/udf/balloc.c
··· 238 238 239 239 mutex_lock(&sbi->s_alloc_mutex); 240 240 part_len = sbi->s_partmaps[partition].s_partition_len; 241 - if (first_block < 0 || first_block >= part_len) 241 + if (first_block >= part_len) 242 242 goto out; 243 243 244 244 if (first_block + block_count > part_len) ··· 297 297 mutex_lock(&sbi->s_alloc_mutex); 298 298 299 299 repeat: 300 - if (goal < 0 || goal >= sbi->s_partmaps[partition].s_partition_len) 300 + if (goal >= sbi->s_partmaps[partition].s_partition_len) 301 301 goal = 0; 302 302 303 303 nr_groups = bitmap->s_nr_groups; ··· 666 666 int8_t etype = -1; 667 667 struct udf_inode_info *iinfo; 668 668 669 - if (first_block < 0 || 670 - first_block >= sbi->s_partmaps[partition].s_partition_len) 669 + if (first_block >= sbi->s_partmaps[partition].s_partition_len) 671 670 return 0; 672 671 673 672 iinfo = UDF_I(table); ··· 742 743 return newblock; 743 744 744 745 mutex_lock(&sbi->s_alloc_mutex); 745 - if (goal < 0 || goal >= sbi->s_partmaps[partition].s_partition_len) 746 + if (goal >= sbi->s_partmaps[partition].s_partition_len) 746 747 goal = 0; 747 748 748 749 /* We search for the closest matching block to goal. If we find
+6 -1
fs/udf/lowlevel.c
··· 56 56 struct block_device *bdev = sb->s_bdev; 57 57 unsigned long lblock = 0; 58 58 59 - if (ioctl_by_bdev(bdev, CDROM_LAST_WRITTEN, (unsigned long) &lblock)) 59 + /* 60 + * ioctl failed or returned obviously bogus value? 61 + * Try using the device size... 62 + */ 63 + if (ioctl_by_bdev(bdev, CDROM_LAST_WRITTEN, (unsigned long) &lblock) || 64 + lblock == 0) 60 65 lblock = bdev->bd_inode->i_size >> sb->s_blocksize_bits; 61 66 62 67 if (lblock)