kernel_optimize_test/fs/xfs
Darrick J. Wong 932befe39d xfs: fix s_maxbytes computation on 32-bit kernels
I observed a hang in generic/308 while running fstests on a i686 kernel.
The hang occurred when trying to purge the pagecache on a large sparse
file that had a page created past MAX_LFS_FILESIZE, which caused an
integer overflow in the pagecache xarray and resulted in an infinite
loop.

I then noticed that Linus changed the definition of MAX_LFS_FILESIZE in
commit 0cc3b0ec23 ("Clarify (and fix) MAX_LFS_FILESIZE macros") so
that it is now one page short of the maximum page index on 32-bit
kernels.  Because the XFS function to compute max offset open-codes the
2005-era MAX_LFS_FILESIZE computation and neither the vfs nor mm perform
any sanity checking of s_maxbytes, the code in generic/308 can create a
page above the pagecache's limit and kaboom.

Fix all this by setting s_maxbytes to MAX_LFS_FILESIZE directly and
aborting the mount with a warning if our assumptions ever break.  I have
no answer for why this seems to have been broken for years and nobody
noticed.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2020-01-14 08:02:53 -08:00
..
libxfs xfs: introduce XFS_MAX_FILEOFF 2020-01-14 08:02:51 -08:00
scrub xfs: remove bogus assertion when online repair isn't enabled 2020-01-09 10:55:19 -08:00
Kconfig
kmem.c
kmem.h
Makefile
mrlock.h
xfs_acl.c xfs: Remove all strlen in all xfs_attr_* functions for attr names. 2020-01-09 10:55:19 -08:00
xfs_acl.h
xfs_aops.c
xfs_aops.h
xfs_attr_inactive.c
xfs_attr_list.c
xfs_bio_io.c
xfs_bmap_item.c
xfs_bmap_item.h
xfs_bmap_util.c xfs: stabilize insert range start boundary to avoid COW writeback race 2019-12-11 13:18:42 -08:00
xfs_bmap_util.h
xfs_buf_item.c xfs: use bitops interface for buf log item AIL flag check 2019-12-19 07:53:47 -08:00
xfs_buf_item.h
xfs_buf.c
xfs_buf.h
xfs_dir2_readdir.c
xfs_discard.c
xfs_discard.h
xfs_dquot_item.c
xfs_dquot_item.h
xfs_dquot.c xfs: quota: move to time64_t interfaces 2020-01-06 08:57:37 -08:00
xfs_dquot.h
xfs_error.c
xfs_error.h
xfs_export.c
xfs_export.h
xfs_extent_busy.c
xfs_extent_busy.h
xfs_extfree_item.c
xfs_extfree_item.h
xfs_file.c
xfs_filestream.c
xfs_filestream.h
xfs_fsmap.c
xfs_fsmap.h
xfs_fsops.c
xfs_fsops.h
xfs_globals.c
xfs_health.c
xfs_icache.c
xfs_icache.h
xfs_icreate_item.c
xfs_icreate_item.h
xfs_inode_item.c
xfs_inode_item.h
xfs_inode.c xfs: truncate should remove all blocks, not just to the end of the page cache 2020-01-14 08:02:52 -08:00
xfs_inode.h
xfs_ioctl.c xfs: Remove all strlen in all xfs_attr_* functions for attr names. 2020-01-09 10:55:19 -08:00
xfs_ioctl.h
xfs_ioctl32.c xfs: reject invalid flags combinations in XFS_IOC_ATTRMULTI_BY_HANDLE 2020-01-09 10:55:18 -08:00
xfs_ioctl32.h xfs: rename compat_time_t to old_time32_t 2020-01-06 08:57:36 -08:00
xfs_iomap.c
xfs_iomap.h
xfs_iops.c xfs: Remove all strlen in all xfs_attr_* functions for attr names. 2020-01-09 10:55:19 -08:00
xfs_iops.h
xfs_itable.c
xfs_itable.h
xfs_iwalk.c
xfs_iwalk.h
xfs_linux.h
xfs_log_cil.c
xfs_log_priv.h
xfs_log_recover.c
xfs_log.c xfs: fix mount failure crash on invalid iclog memory access 2019-12-03 14:53:07 -08:00
xfs_log.h
xfs_message.c
xfs_message.h
xfs_mount.c xfs: don't commit sunit/swidth updates to disk if that would cause repair failures 2019-12-19 07:53:48 -08:00
xfs_mount.h
xfs_mru_cache.c
xfs_mru_cache.h
xfs_ondisk.h
xfs_pnfs.c
xfs_pnfs.h
xfs_pwork.c
xfs_pwork.h
xfs_qm_bhv.c
xfs_qm_syscalls.c
xfs_qm.c
xfs_qm.h xfs: quota: move to time64_t interfaces 2020-01-06 08:57:37 -08:00
xfs_quota.h
xfs_quotaops.c xfs: quota: move to time64_t interfaces 2020-01-06 08:57:37 -08:00
xfs_refcount_item.c
xfs_refcount_item.h
xfs_reflink.c xfs: introduce XFS_MAX_FILEOFF 2020-01-14 08:02:51 -08:00
xfs_reflink.h
xfs_rmap_item.c
xfs_rmap_item.h
xfs_rtalloc.c
xfs_rtalloc.h
xfs_stats.c
xfs_stats.h
xfs_super.c xfs: fix s_maxbytes computation on 32-bit kernels 2020-01-14 08:02:53 -08:00
xfs_super.h
xfs_symlink.c
xfs_symlink.h
xfs_sysctl.c
xfs_sysctl.h
xfs_sysfs.c
xfs_sysfs.h
xfs_trace.c
xfs_trace.h xfs: don't commit sunit/swidth updates to disk if that would cause repair failures 2019-12-19 07:53:48 -08:00
xfs_trans_ail.c
xfs_trans_buf.c
xfs_trans_dquot.c xfs: quota: move to time64_t interfaces 2020-01-06 08:57:37 -08:00
xfs_trans_priv.h
xfs_trans.c
xfs_trans.h
xfs_xattr.c xfs: Remove all strlen in all xfs_attr_* functions for attr names. 2020-01-09 10:55:19 -08:00
xfs.h