summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2025-03-12 10:47:11 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-05-02 07:50:42 +0200
commitf55e7f8abbd3f6f2402882183051f3bbc49a7b4c (patch)
tree39a199406fe8595f2024b2941b137fc64183e567 /fs
parentd70c078c26c0ae27d4a55336ac40cb724333ef87 (diff)
downloadlinux-f55e7f8abbd3f6f2402882183051f3bbc49a7b4c.tar.gz
linux-f55e7f8abbd3f6f2402882183051f3bbc49a7b4c.tar.bz2
linux-f55e7f8abbd3f6f2402882183051f3bbc49a7b4c.zip
ceph: Fix incorrect flush end position calculation
[ Upstream commit f452a2204614fc10e2c3b85904c4bd300c2789dc ] In ceph, in fill_fscrypt_truncate(), the end flush position is calculated by: loff_t lend = orig_pos + CEPH_FSCRYPT_BLOCK_SHIFT - 1; but that's using the block shift not the block size. Fix this to use the block size instead. Fixes: 5c64737d2536 ("ceph: add truncate size handling support for fscrypt") Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ceph/inode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index db6977c15c28..f0befbeb6cb8 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -2319,7 +2319,7 @@ static int fill_fscrypt_truncate(struct inode *inode,
/* Try to writeback the dirty pagecaches */
if (issued & (CEPH_CAP_FILE_BUFFER)) {
- loff_t lend = orig_pos + CEPH_FSCRYPT_BLOCK_SHIFT - 1;
+ loff_t lend = orig_pos + CEPH_FSCRYPT_BLOCK_SIZE - 1;
ret = filemap_write_and_wait_range(inode->i_mapping,
orig_pos, lend);