diff options
author | Luis Henriques <lhenriques@suse.com> | 2018-01-05 11:47:21 +0100 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2018-04-02 11:17:52 +0200 |
commit | 2b83845f8bd711e66e1c367a9bd56c9df3410236 (patch) | |
tree | b2f750e237d72cc4bd2ffe80ef427ac4116d40e3 /fs/ceph/inode.c | |
parent | ceph: quota: don't allow cross-quota renames (diff) | |
download | linux-2b83845f8bd711e66e1c367a9bd56c9df3410236.tar.xz linux-2b83845f8bd711e66e1c367a9bd56c9df3410236.zip |
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.c | 4 |
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)) |