linux/fs/ceph
Luis Henriques d31d07b97a ceph: fix end offset in truncate_inode_pages_range call
Commit e450f4d1a5 ("ceph: pass inclusive lend parameter to
filemap_write_and_wait_range()") fixed the end offset parameter used to
call filemap_write_and_wait_range and invalidate_inode_pages2_range.
Unfortunately it missed truncate_inode_pages_range, introducing a
regression that is easily detected by xfstest generic/130.

The problem is that when doing direct IO it is possible that an extra page
is truncated from the page cache when the end offset is page aligned.
This can cause data loss if that page hasn't been sync'ed to the OSDs.

While there, change code to use PAGE_ALIGN macro instead.

Cc: stable@vger.kernel.org
Fixes: e450f4d1a5 ("ceph: pass inclusive lend parameter to filemap_write_and_wait_range()")
Signed-off-by: Luis Henriques <lhenriques@suse.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2019-07-08 14:01:45 +02:00
..
acl.c ceph: rename struct ceph_acls_info to ceph_acl_sec_ctx 2019-07-08 14:01:42 +02:00
addr.c ceph: increment change_attribute on local changes 2019-07-08 14:01:44 +02:00
cache.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 188 2019-05-30 11:29:21 -07:00
cache.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 188 2019-05-30 11:29:21 -07:00
caps.c ceph: more precise CEPH_CLIENT_CAPS_PENDING_CAPSNAP 2019-07-08 14:01:44 +02:00
ceph_frag.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
debugfs.c ceph: silence a checker warning in mdsc_show() 2019-07-08 14:01:40 +02:00
dir.c ceph: add selinux support 2019-07-08 14:01:42 +02:00
export.c ceph: fix warning PTR_ERR_OR_ZERO can be used 2019-07-08 14:01:42 +02:00
file.c ceph: fix end offset in truncate_inode_pages_range call 2019-07-08 14:01:45 +02:00
inode.c ceph: use generic_delete_inode() for ->drop_inode 2019-07-08 14:01:45 +02:00
ioctl.c libceph, ceph: move ceph_calc_file_object_mapping() to striper.c 2018-04-02 10:12:43 +02:00
ioctl.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig ceph: add selinux support 2019-07-08 14:01:42 +02:00
locks.c ceph: remove duplicated filelock ref increase 2019-05-07 19:22:36 +02:00
Makefile ceph: quota: add initial infrastructure to support cephfs quotas 2018-04-02 11:17:51 +02:00
mds_client.c ceph: add change_attr field to ceph_inode_info 2019-07-08 14:01:43 +02:00
mds_client.h ceph: add change_attr field to ceph_inode_info 2019-07-08 14:01:43 +02:00
mdsmap.c ceph: have MDS map decoding use entity_addr_t decoder 2019-07-08 14:01:43 +02:00
quota.c ceph: fix infinite loop in get_quota_realm() 2019-07-08 14:01:42 +02:00
snap.c ceph: handle change_attr in cap messages 2019-07-08 14:01:43 +02:00
strings.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
super.c ceph: use generic_delete_inode() for ->drop_inode 2019-07-08 14:01:45 +02:00
super.h ceph: use generic_delete_inode() for ->drop_inode 2019-07-08 14:01:45 +02:00
xattr.c ceph: don't NULL terminate virtual xattrs 2019-07-08 14:01:44 +02:00