diff options
author | 2024-04-15 14:55:05 -0700 | |
---|---|---|
committer | 2024-04-15 14:58:59 -0700 | |
commit | 5f204051d998ec3d7306db0d749bddcbf4c97693 (patch) | |
tree | fbf4b51ab481d698a0e7186efe382fed5ca87112 /tools/perf/scripts/python/syscall-counts.py | |
parent | xfs: try to avoid allocating from sick inode clusters (diff) | |
download | wireguard-linux-5f204051d998ec3d7306db0d749bddcbf4c97693.tar.xz wireguard-linux-5f204051d998ec3d7306db0d749bddcbf4c97693.zip |
xfs: pin inodes that would otherwise overflow link count
The VFS inc_nlink function does not explicitly check for integer
overflows in the i_nlink field. Instead, it checks the link count
against s_max_links in the vfs_{link,create,rename} functions. XFS
sets the maximum link count to 2.1 billion, so integer overflows should
not be a problem.
However. It's possible that online repair could find that a file has
more than four billion links, particularly if the link count got
corrupted while creating hardlinks to the file. The di_nlinkv2 field is
not large enough to store a value larger than 2^32, so we ought to
define a magic pin value of ~0U which means that the inode never gets
deleted. This will prevent a UAF error if the repair finds this
situation and users begin deleting links to the file.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'tools/perf/scripts/python/syscall-counts.py')
0 files changed, 0 insertions, 0 deletions