From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Layton Subject: Re: New sparse warning on setting s_maxbytes? Date: Wed, 3 Oct 2012 15:49:59 -0400 Message-ID: <20121003154959.06f51a7b@tlielax.poochiereds.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: linux-fsdevel To: Steve French Return-path: Received: from mx1.redhat.com ([209.132.183.28]:53410 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752923Ab2JCTuB (ORCPT ); Wed, 3 Oct 2012 15:50:01 -0400 In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, 3 Oct 2012 14:07:55 -0500 Steve French wrote: > I noticed this new sparse warning on setting s_maxbytes > fs/cifs/cifsfs.c:109:34: warning: constant 0x7fffffffffffffff is so > big it is long > > e.g. cifsfs.c, as do various other file systems, has > > sb->s_maxbytes = MAX_LFS_FILESIZE; > > fs.h defines it: > > /* Page cache limit. The filesystems should put that into their s_maxbytes > limits, otherwise bad things can happen in VM. */ > #if BITS_PER_LONG==32 > #define MAX_LFS_FILESIZE (((loff_t)PAGE_CACHE_SIZE << (BITS_PER_LONG-1))-1) > #elif BITS_PER_LONG==64 > #define MAX_LFS_FILESIZE ((loff_t)0x7fffffffffffffff) > #endif > > It looks like recent commit 2bd2c1941f141ad780135ccc1cd08ca71a24f10a > ("MAX_LFS_FILESIZE should be a loff_t") causes the warning. Removes > one warning but causes another. > That sounds like a sparse bug. loff_t is a "long long" AFAICT, which should be fine to hold that large a value... -- Jeff Layton