In ceph_llseek(), we compare fsc->max_file_size and inode->i_siz to choose max file size limit. Signed-off-by: Chengguang Xu <cgxu519@xxxxxxx> --- fs/ceph/file.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 23b30cf8caf4..3df0dd22b6ed 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -1564,8 +1564,10 @@ static ssize_t ceph_write_iter(struct kiocb *iocb, struct iov_iter *from) static loff_t ceph_llseek(struct file *file, loff_t offset, int whence) { struct inode *inode = file->f_mapping->host; + struct ceph_fs_client *fsc = inode->i_sb->s_fs_info; loff_t i_size; loff_t ret; + loff_t limit; inode_lock(inode); @@ -1608,7 +1610,8 @@ static loff_t ceph_llseek(struct file *file, loff_t offset, int whence) break; } - ret = vfs_setpos(file, offset, inode->i_sb->s_maxbytes); + limit = max(i_size, fsc->max_file_size); + ret = vfs_setpos(file, offset, limit); out: inode_unlock(inode); -- 2.17.1 -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html