diff mbox

[2/2] ceph: add d_drop for some error cases in ceph_symlink()

Message ID 20180709141731.18136-2-cgxu519@gmx.com (mailing list archive)
State New, archived
Headers show

Commit Message

Chengguang Xu July 9, 2018, 2:17 p.m. UTC
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>
---

Hello,

Sorry, I haven't got resource to fully test this patch, so please review.

 fs/ceph/dir.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index 813c01e8ad05..52a20e3c1f79 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -887,8 +887,10 @@  static int ceph_symlink(struct inode *dir, struct dentry *dentry,
 	if (ceph_snap(dir) != CEPH_NOSNAP)
 		return -EROFS;
 
-	if (ceph_quota_is_max_files_exceeded(dir))
-		return -EDQUOT;
+	if (ceph_quota_is_max_files_exceeded(dir)) {
+		err = -EDQUOT;
+		goto out;
+	}
 
 	dout("symlink in dir %p dentry %p to '%s'\n", dir, dentry, dest);
 	req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_SYMLINK, USE_AUTH_MDS);