Skip to content

Commit

Permalink
jfs should use MAX_LFS_FILESIZE when calculating s_maxbytes
Browse files Browse the repository at this point in the history
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 by commit 0cc3b0e ("Clarify (and fix) MAX_LFS_FILESIZE
macros"), so we can simplify the code now.

Suggested by Andreas Dilger.

Signed-off-by: Dave Kleikamp <[email protected]>
Reviewed-by: Andreas Dilger <[email protected]>
Cc: [email protected]
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
kleikamp authored and torvalds committed Sep 1, 2017
1 parent 42ff72c commit c227390
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions fs/jfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit c227390

Please sign in to comment.