summaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorChengguang Xu <cgxu519@gmx.com>2018-07-09 10:17:31 -0400
committerIlya Dryomov <idryomov@gmail.com>2018-08-02 15:26:12 -0400
commit67fcd151400242757edbab710402161b2cd38989 (patch)
treef79a21866b32d501afc05c3efaf643c5a2e7080d /fs/ceph
parent0459871c4995d0bd57d6b1694f0971ec5cabafc1 (diff)
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>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/dir.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index 4b6a49fd2a61..0210b02b86d4 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -885,8 +885,10 @@ static int ceph_symlink(struct inode *dir, struct dentry *dentry,
885 if (ceph_snap(dir) != CEPH_NOSNAP) 885 if (ceph_snap(dir) != CEPH_NOSNAP)
886 return -EROFS; 886 return -EROFS;
887 887
888 if (ceph_quota_is_max_files_exceeded(dir)) 888 if (ceph_quota_is_max_files_exceeded(dir)) {
889 return -EDQUOT; 889 err = -EDQUOT;
890 goto out;
891 }
890 892
891 dout("symlink in dir %p dentry %p to '%s'\n", dir, dentry, dest); 893 dout("symlink in dir %p dentry %p to '%s'\n", dir, dentry, dest);
892 req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_SYMLINK, USE_AUTH_MDS); 894 req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_SYMLINK, USE_AUTH_MDS);