From: Al Viro <viro@ZenIV.linux.org.uk>
To: Jeff Layton <jlayton@redhat.com>
Cc: Steve French <smfrench@gmail.com>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: New sparse warning on setting s_maxbytes?
Date: Wed, 3 Oct 2012 20:52:43 +0100 [thread overview]
Message-ID: <20121003195243.GE23473@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20121003154959.06f51a7b@tlielax.poochiereds.net>
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@gmail.com> 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...
next prev parent reply other threads:[~2012-10-03 19:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-03 19:07 New sparse warning on setting s_maxbytes? Steve French
2012-10-03 19:49 ` Jeff Layton
2012-10-03 19:52 ` Al Viro [this message]
2012-10-03 20:08 ` Steve French
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121003195243.GE23473@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=jlayton@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=smfrench@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).