Skip to content

Commit f452a22

Browse files
dhowellsidryomov
authored andcommitted
ceph: Fix incorrect flush end position calculation
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: 5c64737 ("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>
1 parent aed06d3 commit f452a22

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ceph/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2362,7 +2362,7 @@ static int fill_fscrypt_truncate(struct inode *inode,
23622362

23632363
/* Try to writeback the dirty pagecaches */
23642364
if (issued & (CEPH_CAP_FILE_BUFFER)) {
2365-
loff_t lend = orig_pos + CEPH_FSCRYPT_BLOCK_SHIFT - 1;
2365+
loff_t lend = orig_pos + CEPH_FSCRYPT_BLOCK_SIZE - 1;
23662366

23672367
ret = filemap_write_and_wait_range(inode->i_mapping,
23682368
orig_pos, lend);

0 commit comments

Comments
 (0)