@@ -1556,8 +1556,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);
@@ -1600,7 +1602,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);
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@gmx.com> --- fs/ceph/file.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)