summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ceph/inode.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index d62f65f2875d..ebc7bdaed2d0 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -2157,6 +2157,7 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr)
2157int ceph_setattr(struct dentry *dentry, struct iattr *attr) 2157int ceph_setattr(struct dentry *dentry, struct iattr *attr)
2158{ 2158{
2159 struct inode *inode = d_inode(dentry); 2159 struct inode *inode = d_inode(dentry);
2160 struct ceph_fs_client *fsc = ceph_inode_to_client(inode);
2160 int err; 2161 int err;
2161 2162
2162 if (ceph_snap(inode) != CEPH_NOSNAP) 2163 if (ceph_snap(inode) != CEPH_NOSNAP)
@@ -2167,6 +2168,10 @@ int ceph_setattr(struct dentry *dentry, struct iattr *attr)
2167 return err; 2168 return err;
2168 2169
2169 if ((attr->ia_valid & ATTR_SIZE) && 2170 if ((attr->ia_valid & ATTR_SIZE) &&
2171 attr->ia_size > max(inode->i_size, fsc->max_file_size))
2172 return -EFBIG;
2173
2174 if ((attr->ia_valid & ATTR_SIZE) &&
2170 ceph_quota_is_max_bytes_exceeded(inode, attr->ia_size)) 2175 ceph_quota_is_max_bytes_exceeded(inode, attr->ia_size))
2171 return -EDQUOT; 2176 return -EDQUOT;
2172 2177