diff options
author | Andreas Gruenbacher <agruenba@redhat.com> | 2020-01-06 08:58:23 -0800 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2020-01-06 08:58:23 -0800 |
commit | 62e298db3fc3ebf41d996f3c86b44cbbdd3286bc (patch) | |
tree | e517d8f0d87dc0e9f953aa943a3b6dab0a5e365a /net/ipv6/inet6_hashtables.c | |
parent | fd6988496e79a6a4bdb514a4655d2920209eb85d (diff) |
fs: Fix page_mkwrite off-by-one errorsiomap-5.6-merge-2
The check in block_page_mkwrite that is meant to determine whether an
offset is within the inode size is off by one. This bug has been copied
into iomap_page_mkwrite and several filesystems (ubifs, ext4, f2fs,
ceph).
Fix that by introducing a new page_mkwrite_check_truncate helper that
checks for truncate and computes the bytes in the page up to EOF. Use
the helper in the above mentioned filesystems.
In addition, use the new helper in btrfs as well.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Acked-by: David Sterba <dsterba@suse.com> (btrfs part)
Acked-by: Richard Weinberger <richard@nod.at> (ubifs part)
Acked-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
[darrick: drop the f2fs part (no ack) and fix build warning]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'net/ipv6/inet6_hashtables.c')
0 files changed, 0 insertions, 0 deletions