CEPH filesystem development
 help / color / mirror / Atom feed
From: deepakroag <gaikwad.dcg@gmail.com>
To: Ilya Dryomov <idryomov@gmail.com>,
	Alex Markuze <amarkuze@redhat.com>,
	Viacheslav Dubeyko <slava@dubeyko.com>,
	ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] fix: release unused ceph cap reservation on readdir error
Date: Wed, 15 Jul 2026 23:46:11 +0530	[thread overview]
Message-ID: <20260715181612.18192-1-gaikwad.dcg@gmail.com> (raw)

Return unused reserved caps to the MDS client pool when
ceph_readdir_prepopulate() exits with an error.

Corrected standalone submission: this patch was mistakenly
sent earlier as [PATCH 4/4] in an unrelated multi-subsystem
series.  It is ceph-only and resubmitted here as [PATCH 1/1].

Link: https://lore.kernel.org/ceph-devel/20260715143646.15828-4-gaikwad.dcg@gmail.com/

Signed-off-by: deepakroag <gaikwad.dcg@gmail.com>
---
 fs/ceph/inode.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index 61d7c0b81..2d6a80054 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -2188,6 +2188,8 @@ int ceph_readdir_prepopulate(struct ceph_mds_request *req,
 		dput(dn);
 	}
 out:
+	if (err)
+		ceph_unreserve_caps(req->r_mdsc, &req->r_caps_reservation);
 	if (err == 0 && skipped == 0) {
 		set_bit(CEPH_MDS_R_DID_PREPOPULATE, &req->r_req_flags);
 		req->r_readdir_cache_idx = cache_ctl.index;
-- 
Deepak Rao Gaikwad


         reply	other threads:[~2026-07-15 18:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260715143646.15828-1-gaikwad.dcg@gmail.com>
2026-07-15 14:36 ` [PATCH 4/4] ceph: release unused cap reservation on readdir error deepakraog
2026-07-15 17:51   ` Viacheslav Dubeyko
2026-07-15 18:16     ` deepakroag [this message]
2026-07-16 17:24       ` [PATCH] fix: release unused ceph " Viacheslav Dubeyko
2026-07-15 18:16     ` [PATCH 4/4] " deepakroag
2026-07-15 18:26       ` deepakroag

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260715181612.18192-1-gaikwad.dcg@gmail.com \
    --to=gaikwad.dcg@gmail.com \
    --cc=amarkuze@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=idryomov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=slava@dubeyko.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox