summaryrefslogtreecommitdiffstats
path: root/fs/ceph/inode.c
diff options
context:
space:
mode:
authorLuis Henriques <lhenriques@suse.com>2018-01-05 10:47:21 +0000
committerIlya Dryomov <idryomov@gmail.com>2018-04-02 11:17:52 +0200
commit2b83845f8bd711e66e1c367a9bd56c9df3410236 (patch)
treeb2f750e237d72cc4bd2ffe80ef427ac4116d40e3 /fs/ceph/inode.c
parentcafe21a4fb3075fb2980caba8fdb533a1bdb52b0 (diff)
downloadlinux-2b83845f8bd711e66e1c367a9bd56c9df3410236.tar.bz2
ceph: quota: support for ceph.quota.max_bytes
Signed-off-by: Luis Henriques <lhenriques@suse.com> Reviewed-by: "Yan, Zheng" <zyan@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/inode.c')
-rw-r--r--fs/ceph/inode.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index 2c6f8be4ed63..50ccae151ea0 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -2147,6 +2147,10 @@ int ceph_setattr(struct dentry *dentry, struct iattr *attr)
if (err != 0)
return err;
+ if ((attr->ia_valid & ATTR_SIZE) &&
+ ceph_quota_is_max_bytes_exceeded(inode, attr->ia_size))
+ return -EDQUOT;
+
err = __ceph_setattr(inode, attr);
if (err >= 0 && (attr->ia_valid & ATTR_MODE))