CEPH filesystem development
 help / color / mirror / Atom feed
From: deepakraog <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 4/4] ceph: release unused cap reservation on readdir error
Date: Wed, 15 Jul 2026 20:06:44 +0530	[thread overview]
Message-ID: <20260715143646.15828-4-gaikwad.dcg@gmail.com> (raw)
In-Reply-To: <20260715143646.15828-1-gaikwad.dcg@gmail.com>

ceph_readdir_prepopulate() can exit with an error after partially
consuming the request's cap reservation. Return unused reserved caps to
the MDS client pool on the error path so they are not held until request
teardown.

Signed-off-by: deepakraog <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 14:37 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 ` deepakraog [this message]
2026-07-15 17:51   ` [PATCH 4/4] ceph: release unused cap reservation on readdir error Viacheslav Dubeyko
2026-07-15 18:16     ` [PATCH] fix: release unused ceph " deepakroag
2026-07-16 17:24       ` 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=20260715143646.15828-4-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