Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ceph: fscache: Update object store limit after file writing

Synchronize object->store_limit[_l] with new inode->i_size after file writing.

Tested-by: Milosz Tanski <milosz@adfin.com>
Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
Signed-off-by: Min Chen <minchen@ubuntukylin.com>
Signed-off-by: Li Wang <liwang@ubuntukylin.com>

authored by

Yunchuan Wen and committed by
Yan, Zheng
32d3e148 020c4bdd

+3
+3
fs/ceph/file.c
··· 970 970 goto retry_snap; 971 971 } 972 972 } else { 973 + loff_t old_size = inode->i_size; 973 974 /* 974 975 * No need to acquire the i_truncate_mutex. Because 975 976 * the MDS revokes Fwb caps before sending truncate ··· 981 980 written = generic_file_buffered_write(iocb, iov, nr_segs, 982 981 pos, &iocb->ki_pos, 983 982 count, 0); 983 + if (inode->i_size > old_size) 984 + ceph_fscache_update_objectsize(inode); 984 985 mutex_unlock(&inode->i_mutex); 985 986 } 986 987