goto out;
}
- if (ceph_quota_is_max_files_exceeded(dir)) {
+ if (op == CEPH_MDS_OP_MKDIR &&
+ ceph_quota_is_max_files_exceeded(dir)) {
err = -EDQUOT;
goto out;
}
struct ceph_vino vino;
struct inode *in;
+ if (ceph_snap(inode) != CEPH_NOSNAP)
+ return NULL;
+
realm = ceph_inode(inode)->i_snap_realm;
- ceph_get_snap_realm(mdsc, realm);
+ if (realm)
+ ceph_get_snap_realm(mdsc, realm);
+ else
+ pr_err_ratelimited("get_quota_realm: ino (%llx.%llx) "
+ "null i_snap_realm\n", ceph_vinop(inode));
while (realm) {
vino.ino = realm->ino;
vino.snap = CEPH_NOSNAP;
bool is_root;
bool exceeded = false;
+ if (ceph_snap(inode) != CEPH_NOSNAP)
+ return false;
+
down_read(&mdsc->snap_rwsem);
realm = ceph_inode(inode)->i_snap_realm;
- ceph_get_snap_realm(mdsc, realm);
+ if (realm)
+ ceph_get_snap_realm(mdsc, realm);
+ else
+ pr_err_ratelimited("check_quota_exceeded: ino (%llx.%llx) "
+ "null i_snap_realm\n", ceph_vinop(inode));
while (realm) {
vino.ino = realm->ino;
vino.snap = CEPH_NOSNAP;