Skip to content

Commit 67fcd15

Browse files
Chengguang Xuidryomov
Chengguang Xu
authored andcommitted
ceph: add d_drop for some error cases in ceph_symlink()
When file num exceeds quota limit, 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 0459871 commit 67fcd15

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fs/ceph/dir.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -885,8 +885,10 @@ static int ceph_symlink(struct inode *dir, struct dentry *dentry,
885885
if (ceph_snap(dir) != CEPH_NOSNAP)
886886
return -EROFS;
887887

888-
if (ceph_quota_is_max_files_exceeded(dir))
889-
return -EDQUOT;
888+
if (ceph_quota_is_max_files_exceeded(dir)) {
889+
err = -EDQUOT;
890+
goto out;
891+
}
890892

891893
dout("symlink in dir %p dentry %p to '%s'\n", dir, dentry, dest);
892894
req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_SYMLINK, USE_AUTH_MDS);

0 commit comments

Comments
 (0)