diff options
author | Zach Brown <[email protected]> | 2013-07-11 16:19:42 -0700 |
---|---|---|
committer | Chris Mason <[email protected]> | 2013-08-09 19:34:56 -0400 |
commit | db62efbbf883c099d44b0fafe18f8ad8f0396892 (patch) | |
tree | dacc595d4b9e32b1736c01efea0580ba6a153903 /tools/perf/util/scripting-engines/trace-event-python.c | |
parent | cfad392b22163eba71d882950e17d2c4d43b2bad (diff) |
btrfs: don't loop on large offsets in readdir
When btrfs readdir() hits the last entry it sets the readdir offset to a
huge value to stop buggy apps from breaking when the same name is
returned by readdir() with concurrent rename()s.
But unconditionally setting the offset to INT_MAX causes readdir() to
loop returning any entries with offsets past INT_MAX. It only takes a
few hours of constant file creation and removal to create entries past
INT_MAX.
So let's set the huge offset to LLONG_MAX if the last entry has already
overflowed 32bit loff_t. Without large offsets behaviour is identical.
With large offsets 64bit apps will work and 32bit apps will be no more
broken than they currently are if they see large offsets.
Signed-off-by: Zach Brown <[email protected]>
Signed-off-by: Josef Bacik <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-python.c')
0 files changed, 0 insertions, 0 deletions