* [PATCH] MAX_LFS_FILESIZE should be a loff_t
@ 2012-09-11 18:22 Chuck Lever
2012-09-12 10:44 ` Jeff Layton
0 siblings, 1 reply; 3+ messages in thread
From: Chuck Lever @ 2012-09-11 18:22 UTC (permalink / raw)
To: jlayton; +Cc: linux-fsdevel
fs/nfs/internal.h: In function ‘nfs_super_set_maxbytes’:
fs/nfs/internal.h:547:21: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
Seen with gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2).
Commit 42cb56ae made s_maxbytes a loff_t, thus the type of
MAX_LFS_FILESIZE should also be a loff_t.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
include/linux/fs.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index aa11047..24dd0ce 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1126,9 +1126,9 @@ static inline int file_check_writeable(struct file *filp)
/* 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 (((u64)PAGE_CACHE_SIZE << (BITS_PER_LONG-1))-1)
+#define MAX_LFS_FILESIZE (((loff_t)PAGE_CACHE_SIZE << (BITS_PER_LONG-1))-1)
#elif BITS_PER_LONG==64
-#define MAX_LFS_FILESIZE 0x7fffffffffffffffUL
+#define MAX_LFS_FILESIZE ((loff_t)0x7fffffffffffffffUL)
#endif
#define FL_POSIX 1
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] MAX_LFS_FILESIZE should be a loff_t
2012-09-11 18:22 Chuck Lever
@ 2012-09-12 10:44 ` Jeff Layton
0 siblings, 0 replies; 3+ messages in thread
From: Jeff Layton @ 2012-09-12 10:44 UTC (permalink / raw)
To: Chuck Lever; +Cc: linux-fsdevel
On Tue, 11 Sep 2012 14:22:29 -0400
Chuck Lever <chuck.lever@oracle.com> wrote:
> fs/nfs/internal.h: In function ‘nfs_super_set_maxbytes’:
> fs/nfs/internal.h:547:21: warning: comparison between signed and
> unsigned integer expressions [-Wsign-compare]
>
> Seen with gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2).
>
> Commit 42cb56ae made s_maxbytes a loff_t, thus the type of
> MAX_LFS_FILESIZE should also be a loff_t.
>
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---
>
> include/linux/fs.h | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index aa11047..24dd0ce 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -1126,9 +1126,9 @@ static inline int file_check_writeable(struct file *filp)
> /* 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 (((u64)PAGE_CACHE_SIZE << (BITS_PER_LONG-1))-1)
> +#define MAX_LFS_FILESIZE (((loff_t)PAGE_CACHE_SIZE << (BITS_PER_LONG-1))-1)
> #elif BITS_PER_LONG==64
> -#define MAX_LFS_FILESIZE 0x7fffffffffffffffUL
> +#define MAX_LFS_FILESIZE ((loff_t)0x7fffffffffffffffUL)
> #endif
>
> #define FL_POSIX 1
>
Acked-by: Jeff Layton <jlayton@redhat.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] MAX_LFS_FILESIZE should be a loff_t
@ 2012-09-24 18:51 Chuck Lever
0 siblings, 0 replies; 3+ messages in thread
From: Chuck Lever @ 2012-09-24 18:51 UTC (permalink / raw)
To: viro; +Cc: linux-fsdevel
fs/nfs/internal.h: In function ‘nfs_super_set_maxbytes’:
fs/nfs/internal.h:547:21: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
Seen with gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2).
Commit 42cb56ae made s_maxbytes a loff_t, thus the type of
MAX_LFS_FILESIZE should also be a loff_t.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Acked-by: Jeff Layton <jlayton@redhat.com>
---
Tested with x86_64 only.
include/linux/fs.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index aa11047..f623c42 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1126,9 +1126,9 @@ static inline int file_check_writeable(struct file *filp)
/* 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 (((u64)PAGE_CACHE_SIZE << (BITS_PER_LONG-1))-1)
+#define MAX_LFS_FILESIZE (((loff_t)PAGE_CACHE_SIZE << (BITS_PER_LONG-1))-1)
#elif BITS_PER_LONG==64
-#define MAX_LFS_FILESIZE 0x7fffffffffffffffUL
+#define MAX_LFS_FILESIZE ((loff_t)0x7fffffffffffffff)
#endif
#define FL_POSIX 1
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-09-24 18:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-24 18:51 [PATCH] MAX_LFS_FILESIZE should be a loff_t Chuck Lever
-- strict thread matches above, loose matches on Subject: below --
2012-09-11 18:22 Chuck Lever
2012-09-12 10:44 ` Jeff Layton
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).