summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/bin/sctop-record
diff options
context:
space:
mode:
authorGao Xiang <hsiangkao@redhat.com>2020-11-14 11:06:01 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2020-11-18 09:23:51 -0800
commitada49d64fb3538144192181db05de17e2ffc3551 (patch)
tree4330a5ad5f8d6cdfef9444790f54bfa8f190d3c7 /tools/perf/scripts/python/bin/sctop-record
parent6b48e5b8a20f653b7d64ccf99a498f2523bff752 (diff)
downloadkernel-ada49d64fb3538144192181db05de17e2ffc3551.tar.gz
xfs: fix forkoff miscalculation related to XFS_LITINO(mp)
Currently, commit e9e2eae89ddb dropped a (int) decoration from XFS_LITINO(mp), and since sizeof() expression is also involved, the result of XFS_LITINO(mp) is simply as the size_t type (commonly unsigned long). Considering the expression in xfs_attr_shortform_bytesfit(): offset = (XFS_LITINO(mp) - bytes) >> 3; let "bytes" be (int)340, and "XFS_LITINO(mp)" be (unsigned long)336. on 64-bit platform, the expression is offset = ((unsigned long)336 - (int)340) >> 3 = (int)(0xfffffffffffffffcUL >> 3) = -1 but on 32-bit platform, the expression is offset = ((unsigned long)336 - (int)340) >> 3 = (int)(0xfffffffcUL >> 3) = 0x1fffffff instead. so offset becomes a large positive number on 32-bit platform, and cause xfs_attr_shortform_bytesfit() returns maxforkoff rather than 0. Therefore, one result is "ASSERT(new_size <= XFS_IFORK_SIZE(ip, whichfork));" assertion failure in xfs_idata_realloc(), which was also the root cause of the original bugreport from Dennis, see: https://bugzilla.redhat.com/show_bug.cgi?id=1894177 And it can also be manually triggered with the following commands: $ touch a; $ setfattr -n user.0 -v "`seq 0 80`" a; $ setfattr -n user.1 -v "`seq 0 80`" a on 32-bit platform. Fix the case in xfs_attr_shortform_bytesfit() by bailing out "XFS_LITINO(mp) < bytes" in advance suggested by Eric and a misleading comment together with this bugfix suggested by Darrick. It seems the other users of XFS_LITINO(mp) are not impacted. Fixes: e9e2eae89ddb ("xfs: only check the superblock version for dinode size calculation") Cc: <stable@vger.kernel.org> # 5.7+ Reported-and-tested-by: Dennis Gilmore <dgilmore@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Gao Xiang <hsiangkao@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'tools/perf/scripts/python/bin/sctop-record')
0 files changed, 0 insertions, 0 deletions
hinkpad X300 digital micTakashi Iwai 2008-04-24[ALSA] hda - Add support of AD1989A/AD1989BTakashi Iwai 2008-04-24[ALSA] hda-codec - Support of Lenovo Thinkpad X300Takashi Iwai 2008-04-24[ALSA] hda-codec - keep the format verb at closing PCM streamsTakashi Iwai 2008-04-24[ALSA] sound: hda: missing includes of hda_patch.hHarvey Harrison 2008-04-24[ALSA] hda-codec - Add docking-station mic input for Thinkpad X61Takashi Iwai 2008-04-24[ALSA] Keep private TLV entry in vmaster itselfTakashi Iwai 2008-04-24[ALSA] hda-codec - Add model=mobile for AD1884A & coTakashi Iwai 2008-04-24[ALSA] hda-codec - Add support of AD1883/1884A/1984A/1984BTakashi Iwai 2008-04-24[ALSA] hda-codec - Add "IEC958 Default PCM" switchTakashi Iwai 2008-04-24[ALSA] hda-codec - Implement auto-mic jack sensing on Samsung laptopsTakashi Iwai 2008-04-24[ALSA] hda-codec - Fix automute of AD1981HD hp modelTakashi Iwai 2008-04-24[ALSA] hda-intel - Fix PCM device number assignmentTakashi Iwai 2008-02-29[ALSA] hda-codec - Fix AD1988 capture elementsTakashi Iwai 2008-01-31[ALSA] hda-codec - Add Dell T3400 supportDouglas Kosovic 2008-01-31[ALSA] hda-codec - Add SPDIF output support to AD1986a laptop-eapd modelTakashi Iwai 2008-01-31[ALSA] hda-codec - Add SPDIF controls as slave on AD codecsTakashi Iwai 2008-01-31[ALSA] hda-codec - Add missing slave for AD1884 master switchTakashi Iwai 2008-01-31[ALSA] hda-codec - Remove obsolete FIXME'sTakashi Iwai 2008-01-31[ALSA] hda-codec - Add virtual master controlsTakashi Iwai 2008-01-31[ALSA] Remove sound/driver.hTakashi Iwai 2008-01-31[ALSA] hda-codec - Add IEC958 digital out support for Lenovo Thinkpads T61/X61Jerone Young 2008-01-31[ALSA] hda-codec - Sort ad1986a cfg tableTakashi Iwai 2008-01-31[ALSA] hda-codec - Device ID for Toshiba laptop which uses AD1986AJiang Zhe 2008-01-31[ALSA] hda-codec - sort pci quirk listTakashi Iwai 2008-01-31[ALSA] hda-intel: Enable Analog CD Input from internal ATAPI connector on Asu...Johannes Stezenbach 2008-01-31[ALSA] hda-codec - Check value range in ctl callbacksTakashi Iwai 2008-01-31[ALSA] HDA: Add Asus VX1 supportTobin Davis 2007-11-19[ALSA] hda-codec - Disable shared stream on AD1986ATakashi Iwai