aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChengguang Xu <cgxu519@gmx.com>2018-07-19 10:15:27 -0400
committerIlya Dryomov <idryomov@gmail.com>2018-08-13 11:55:43 -0400
commit9da12e3a7de1665a14063653b60e872da0ee7810 (patch)
tree50aa30146497e8ace171bbbbac5fbc50e2d9338a
parent36a4c72d1c6f5f50d4db14a38f296855ae82571b (diff)
ceph: compare fsc->max_file_size and inode->i_size for max file size limit
In ceph_llseek(), we compare fsc->max_file_size and inode->i_size to choose max file size limit. Signed-off-by: Chengguang Xu <cgxu519@gmx.com> Reviewed-by: "Yan, Zheng" <zyan@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
-rw-r--r--fs/ceph/file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index b9cd9d271dcb..141a64c1f391 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -1554,6 +1554,7 @@ out_unlocked:
1554static loff_t ceph_llseek(struct file *file, loff_t offset, int whence) 1554static loff_t ceph_llseek(struct file *file, loff_t offset, int whence)
1555{ 1555{
1556 struct inode *inode = file->f_mapping->host; 1556 struct inode *inode = file->f_mapping->host;
1557 struct ceph_fs_client *fsc = ceph_inode_to_client(inode);
1557 loff_t i_size; 1558 loff_t i_size;
1558 loff_t ret; 1559 loff_t ret;
1559 1560
@@ -1598,7 +1599,7 @@ static loff_t ceph_llseek(struct file *file, loff_t offset, int whence)
1598 break; 1599 break;
1599 } 1600 }
1600 1601
1601 ret = vfs_setpos(file, offset, inode->i_sb->s_maxbytes); 1602 ret = vfs_setpos(file, offset, max(i_size, fsc->max_file_size));
1602 1603
1603out: 1604out:
1604 inode_unlock(inode); 1605 inode_unlock(inode);