Re: New sparse warning on setting s_maxbytes?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 03, 2012 at 03:49:59PM -0400, Jeff Layton wrote:
> On Wed, 3 Oct 2012 14:07:55 -0500
> Steve French <smfrench@xxxxxxxxx> 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...

Not really - potentially it's a portability problem.  I'll slap LL suffix
there, to make things explicit.  Will be in the next vfs.git pull request...
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux