Skip to content

Commit 0459871

Browse files
Chengguang Xuidryomov
Chengguang Xu
authored andcommitted
ceph: add d_drop for some error cases in ceph_mknod()
When file num exceeds quota limit or fails from ceph_per_init_acls() should call d_drop to drop dentry from cache as well. Signed-off-by: Chengguang Xu <cgxu519@gmx.com> Reviewed-by: "Yan, Zheng" <zyan@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
1 parent 61ad36d commit 0459871

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

fs/ceph/dir.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -827,12 +827,14 @@ static int ceph_mknod(struct inode *dir, struct dentry *dentry,
827827
if (ceph_snap(dir) != CEPH_NOSNAP)
828828
return -EROFS;
829829

830-
if (ceph_quota_is_max_files_exceeded(dir))
831-
return -EDQUOT;
830+
if (ceph_quota_is_max_files_exceeded(dir)) {
831+
err = -EDQUOT;
832+
goto out;
833+
}
832834

833835
err = ceph_pre_init_acls(dir, &mode, &acls);
834836
if (err < 0)
835-
return err;
837+
goto out;
836838

837839
dout("mknod in dir %p dentry %p mode 0%ho rdev %d\n",
838840
dir, dentry, mode, rdev);

0 commit comments

Comments
 (0)