From 55b0b31cbc09f80db384671e22cdc94b2aa26b29 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Mon, 7 Sep 2015 11:35:01 +0800 Subject: [PATCH] ceph: get inode size for each append write Signed-off-by: Yan, Zheng --- fs/ceph/file.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 90ec110b8400..0c62868b5c56 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -952,6 +952,12 @@ static ssize_t ceph_write_iter(struct kiocb *iocb, struct iov_iter *from) /* We can write back this queue in page reclaim */ current->backing_dev_info = inode_to_bdi(inode); + if (iocb->ki_flags & IOCB_APPEND) { + err = ceph_do_getattr(inode, CEPH_STAT_CAP_SIZE, false); + if (err < 0) + goto out; + } + err = generic_write_checks(iocb, from); if (err <= 0) goto out; -- 2.20.1