Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32d3e148 authored by Yunchuan Wen's avatar Yunchuan Wen Committed by Yan, Zheng
Browse files

ceph: fscache: Update object store limit after file writing



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

Tested-by: default avatarMilosz Tanski <milosz@adfin.com>
Signed-off-by: default avatarYunchuan Wen <yunchuanwen@ubuntukylin.com>
Signed-off-by: default avatarMin Chen <minchen@ubuntukylin.com>
Signed-off-by: default avatarLi Wang <liwang@ubuntukylin.com>
parent 020c4bdd
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -970,6 +970,7 @@ static ssize_t ceph_aio_write(struct kiocb *iocb, const struct iovec *iov,
			goto retry_snap;
		}
	} else {
		loff_t old_size = inode->i_size;
		/*
		 * No need to acquire the i_truncate_mutex. Because
		 * the MDS revokes Fwb caps before sending truncate
@@ -980,6 +981,8 @@ static ssize_t ceph_aio_write(struct kiocb *iocb, const struct iovec *iov,
		written = generic_file_buffered_write(iocb, iov, nr_segs,
						      pos, &iocb->ki_pos,
						      count, 0);
		if (inode->i_size > old_size)
			ceph_fscache_update_objectsize(inode);
		mutex_unlock(&inode->i_mutex);
	}