lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20071107051540.GB24266@lixom.net>
Date:	Tue, 6 Nov 2007 23:15:40 -0600
From:	Olof Johansson <olof@...om.net>
To:	torvalds@...ux-foundation.org
Cc:	linux-kernel@...r.kernel.org
Subject: [PATCH] fat: silence warning for 64KB PAGE_SIZE builds

Annoying gcc warning:

fs/fat/inode.c: In function 'fat_fill_super':
fs/fat/inode.c:1222: warning: comparison is always false due to limited range of data type

logical_sector_size can never be more than 16 bits worth, but switching
it to an int silences gcc. It's a sanity check that can never fail with
64KB PAGE_SIZE but it seems like it'd still be useful for other page
sizes, so it's worth keeping:

        if (!is_power_of_2(logical_sector_size)
            || (logical_sector_size < 512)
            || (PAGE_CACHE_SIZE < logical_sector_size)) {
                if (!silent)
                        printk(KERN_ERR "FAT: bogus logical sector size %u\n",
                               logical_sector_size);
                brelse(bh);
                goto out_invalid;
        }


Signed-off-by: Olof Johansson <olof@...om.net>

diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 920a576..6aae680 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -1158,7 +1158,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent,
 	struct buffer_head *bh;
 	struct fat_boot_sector *b;
 	struct msdos_sb_info *sbi;
-	u16 logical_sector_size;
+	int logical_sector_size;
 	u32 total_sectors, total_clusters, fat_clusters, rootdir_sectors;
 	int debug;
 	unsigned int media;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ