Commit 25963669 authored by Yan, Zheng's avatar Yan, Zheng Committed by Ilya Dryomov

ceph: don't check quota for snap inode

snap inode's i_snap_realm is not pointing to ceph_snap_realm.
Signed-off-by: default avatar"Yan, Zheng" <zyan@redhat.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 1ab302a0
...@@ -936,7 +936,8 @@ static int ceph_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) ...@@ -936,7 +936,8 @@ static int ceph_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
goto out; 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; err = -EDQUOT;
goto out; goto out;
} }
......
...@@ -86,8 +86,15 @@ static struct ceph_snap_realm *get_quota_realm(struct ceph_mds_client *mdsc, ...@@ -86,8 +86,15 @@ static struct ceph_snap_realm *get_quota_realm(struct ceph_mds_client *mdsc,
struct ceph_vino vino; struct ceph_vino vino;
struct inode *in; struct inode *in;
if (ceph_snap(inode) != CEPH_NOSNAP)
return NULL;
realm = ceph_inode(inode)->i_snap_realm; realm = ceph_inode(inode)->i_snap_realm;
if (realm)
ceph_get_snap_realm(mdsc, 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) { while (realm) {
vino.ino = realm->ino; vino.ino = realm->ino;
vino.snap = CEPH_NOSNAP; vino.snap = CEPH_NOSNAP;
...@@ -158,9 +165,16 @@ static bool check_quota_exceeded(struct inode *inode, enum quota_check_op op, ...@@ -158,9 +165,16 @@ static bool check_quota_exceeded(struct inode *inode, enum quota_check_op op,
bool is_root; bool is_root;
bool exceeded = false; bool exceeded = false;
if (ceph_snap(inode) != CEPH_NOSNAP)
return false;
down_read(&mdsc->snap_rwsem); down_read(&mdsc->snap_rwsem);
realm = ceph_inode(inode)->i_snap_realm; realm = ceph_inode(inode)->i_snap_realm;
if (realm)
ceph_get_snap_realm(mdsc, 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) { while (realm) {
vino.ino = realm->ino; vino.ino = realm->ino;
vino.snap = CEPH_NOSNAP; vino.snap = CEPH_NOSNAP;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment