Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1724615 > unrolled thread

[PATCH] jfs should use MAX_LFS_FILESIZE when calculating s_maxbytes

Started byDave Kleikamp <dave.kleikamp@oracle.com>
First post2017-08-31 23:50 +0200
Last post2017-09-01 00:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] jfs should use MAX_LFS_FILESIZE when calculating s_maxbytes Dave Kleikamp <dave.kleikamp@oracle.com> - 2017-08-31 23:50 +0200
    Re: [PATCH] jfs should use MAX_LFS_FILESIZE when calculating  s_maxbytes Andreas Dilger <adilger@dilger.ca> - 2017-09-01 00:40 +0200

#1724615 — [PATCH] jfs should use MAX_LFS_FILESIZE when calculating s_maxbytes

FromDave Kleikamp <dave.kleikamp@oracle.com>
Date2017-08-31 23:50 +0200
Subject[PATCH] jfs should use MAX_LFS_FILESIZE when calculating s_maxbytes
Message-ID<ukFvz-2Ku-5@gated-at.bofh.it>
jfs had previously avoided the use of MAX_LFS_FILESIZE because it hadn't
accounted for the whole 32-bit index range on 32-bit systems. That has
been fixed, so we can simplify the code now.

Suggested by Andreas Dilger.

Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Cc: Andreas Dilger <adilger@dilger.ca>
Cc: jfs-discussion@lists.sourceforge.net
---
Linus,
If you don't want to pick this up now, I'll push it in the next merge
window.

 fs/jfs/super.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index 78b41e1d5c67..60726ae7cf26 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -619,16 +619,10 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
 	if (!sb->s_root)
 		goto out_no_root;
 
-	/* logical blocks are represented by 40 bits in pxd_t, etc. */
-	sb->s_maxbytes = ((u64) sb->s_blocksize) << 40;
-#if BITS_PER_LONG == 32
-	/*
-	 * Page cache is indexed by long.
-	 * I would use MAX_LFS_FILESIZE, but it's only half as big
+	/* logical blocks are represented by 40 bits in pxd_t, etc.
+	 * and page cache is indexed by long
 	 */
-	sb->s_maxbytes = min(((u64) PAGE_SIZE << 32) - 1,
-			     (u64)sb->s_maxbytes);
-#endif
+	sb->s_maxbytes = min(((loff_t)sb->s_blocksize) << 40, MAX_LFS_FILESIZE);
 	sb->s_time_gran = 1;
 	return 0;
 
-- 
2.14.1

[toc] | [next] | [standalone]


#1724627 — Re: [PATCH] jfs should use MAX_LFS_FILESIZE when calculating s_maxbytes

FromAndreas Dilger <adilger@dilger.ca>
Date2017-09-01 00:40 +0200
SubjectRe: [PATCH] jfs should use MAX_LFS_FILESIZE when calculating s_maxbytes
Message-ID<ukGhX-3ke-3@gated-at.bofh.it>
In reply to#1724615

[Multipart message — attachments visible in raw view] — view raw

On Aug 31, 2017, at 3:46 PM, Dave Kleikamp <dave.kleikamp@oracle.com> wrote:
> 
> jfs had previously avoided the use of MAX_LFS_FILESIZE because it hadn't
> accounted for the whole 32-bit index range on 32-bit systems. That has
> been fixed, so we can simplify the code now.
> 
> Suggested by Andreas Dilger.
> 
> Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
> Cc: Andreas Dilger <adilger@dilger.ca>

Reviewed-by: Andreas Dilger <adilger@dilger.ca>

> Cc: jfs-discussion@lists.sourceforge.net
> ---
> Linus,
> If you don't want to pick this up now, I'll push it in the next merge
> window.
> 
> fs/jfs/super.c | 12 +++---------
> 1 file changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/fs/jfs/super.c b/fs/jfs/super.c
> index 78b41e1d5c67..60726ae7cf26 100644
> --- a/fs/jfs/super.c
> +++ b/fs/jfs/super.c
> @@ -619,16 +619,10 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
> 	if (!sb->s_root)
> 		goto out_no_root;
> 
> -	/* logical blocks are represented by 40 bits in pxd_t, etc. */
> -	sb->s_maxbytes = ((u64) sb->s_blocksize) << 40;
> -#if BITS_PER_LONG == 32
> -	/*
> -	 * Page cache is indexed by long.
> -	 * I would use MAX_LFS_FILESIZE, but it's only half as big
> +	/* logical blocks are represented by 40 bits in pxd_t, etc.
> +	 * and page cache is indexed by long
> 	 */
> -	sb->s_maxbytes = min(((u64) PAGE_SIZE << 32) - 1,
> -			     (u64)sb->s_maxbytes);
> -#endif
> +	sb->s_maxbytes = min(((loff_t)sb->s_blocksize) << 40, MAX_LFS_FILESIZE);
> 	sb->s_time_gran = 1;
> 	return 0;
> 
> --
> 2.14.1
> 


Cheers, Andreas





[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web