Skip to contentSkip to conversation

sector_t last is unsigned, so cannot be less than 0.

PATCH In review Roel Kluin 2 participants 2 messages Jan 18, 2009 – Jan 19, 2009 UDF filesystem

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 sector_t last is unsigned, so cannot be less than 0.

sector_t last is unsigned, so cannot be less than 0.

---

fs/udf/super.c +1 -1
index e25e701..1f3941d 100644
@@ -721,7 +721,7 @@ static sector_t udf_scan_anchors(struct super_block *sb, sector_t lastblock)
 	 *  however, if the disc isn't closed, it could be 512 */
 
 	for (i = 0; i < ARRAY_SIZE(last); i++) {
-		if (last[i] < 0)
+		if (last[i] > lastblock + 1)
 			continue;
 		if (last[i] >= sb->s_bdev->bd_inode->i_size >>
 				sb->s_blocksize_bits)
#1 lore raw

Hi Roel,

Quoted 9 lines · Roel Kluin

sector_t last is unsigned, so cannot be less than 0.

---

fs/udf/super.c +0 -0
index e25e701..1f3941d 100644

fs/udf/super.c static sector_t udf_scan_anchors(struct super_block *sb, sector_t lastblock) · line 727

Quoted 8 lines
fs/udf/super.c +1 -1
@@ -721,7 +721,7 @@ static sector_t udf_scan_anchors(struct super_block *sb, sector_t lastblock)
 	 *  however, if the disc isn't closed, it could be 512 */
 
 	for (i = 0; i < ARRAY_SIZE(last); i++) {
-		if (last[i] < 0)
+		if (last[i] > lastblock + 1)
 			continue;
 		if (last[i] >= sb->s_bdev->bd_inode->i_size >>
 				sb->s_blocksize_bits)

I already have your cleanup of this check in my UDF tree. I'm sorry it's not
in Linus's tree yet but I forgot to merge it with Linus during the merge window..

Honza

Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR