All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sector_t last is unsigned, so cannot be less than 0.
@ 2009-01-18 22:45 Roel Kluin
  2009-01-19 13:18 ` Jan Kara
  0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-01-18 22:45 UTC (permalink / raw)
  To: jack; +Cc: lkml

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

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/fs/udf/super.c b/fs/udf/super.c
index e25e701..1f3941d 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -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)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] sector_t last is unsigned, so cannot be less than 0.
  2009-01-18 22:45 [PATCH] sector_t last is unsigned, so cannot be less than 0 Roel Kluin
@ 2009-01-19 13:18 ` Jan Kara
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2009-01-19 13:18 UTC (permalink / raw)
  To: Roel Kluin; +Cc: jack, lkml

  Hi Roel,

On Sun 18-01-09 23:45:13, Roel Kluin wrote:
> sector_t last is unsigned, so cannot be less than 0.
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> diff --git a/fs/udf/super.c b/fs/udf/super.c
> index e25e701..1f3941d 100644
> --- a/fs/udf/super.c
> +++ b/fs/udf/super.c
> @@ -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
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-19 13:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-18 22:45 [PATCH] sector_t last is unsigned, so cannot be less than 0 Roel Kluin
2009-01-19 13:18 ` Jan Kara

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.