From: CharSyam <charsyam@gmail.com>
To: Namjae Jeon <linkinjeon@kernel.org>
Cc: Steve French <smfrench@gmail.com>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Tom Talpey <tom@talpey.com>, Hyunchul Lee <hyc.lee@gmail.com>,
Ronnie Sahlberg <lsahlber@redhat.com>,
linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH 2/2] ksmbd: centralize ksmbd_conn final release to plug transport leak
Date: Mon, 27 Apr 2026 10:32:18 +0900 [thread overview]
Message-ID: <CAMrLSE63_CAqUn5JXuSP6RfLMh1r4KArxLet4H56mRudWo4ycQ@mail.gmail.com> (raw)
In-Reply-To: <CAKYAXd_1q_6jXT+A17s5Q6JgUFJvYAt4=GJ3vYG7ruz5x3PexA@mail.gmail.com>
The intent was to snapshot the key returned by idr_get_next() so
that the idr_remove() target was a separate name from the
iteration cursor — the body grew with the two branches and the
unlock/relock around session_fd_check(), and I wanted "the
key we just resolved" to read independently of "the cursor we bump
at the end of the loop".
That said, on re-reading the final shape, id is not modified between
idr_get_next() and either idr_remove() call site, so
saved_id is functionally just an alias. I'll drop it in v3 and pass
id directly.
2026년 4월 27일 (월) 오전 10:07, Namjae Jeon <linkinjeon@kernel.org>님이 작성:
>
> > -
> > - if (skip(tcon, fp, sess->user) ||
> > - !atomic_dec_and_test(&fp->refcount)) {
> > + saved_id = id;
> What is the reason for backing up the id to saved_id?
>
> > + if (!atomic_inc_not_zero(&fp->refcount)) {
> > id++;
> > write_unlock(&ft->lock);
> > continue;
> > }
prev parent reply other threads:[~2026-04-27 1:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-25 9:38 [PATCH 0/2] ksmbd: fix stop_sessions() iteration and centralize ksmbd_conn release DaeMyung Kang
2026-04-25 9:38 ` [PATCH 1/2] ksmbd: rewrite stop_sessions() with restartable iteration DaeMyung Kang
2026-04-26 23:20 ` Namjae Jeon
2026-04-25 9:38 ` [PATCH 2/2] ksmbd: centralize ksmbd_conn final release to plug transport leak DaeMyung Kang
2026-04-27 1:06 ` Namjae Jeon
2026-04-27 1:32 ` CharSyam [this message]
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=CAMrLSE63_CAqUn5JXuSP6RfLMh1r4KArxLet4H56mRudWo4ycQ@mail.gmail.com \
--to=charsyam@gmail.com \
--cc=hyc.lee@gmail.com \
--cc=linkinjeon@kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lsahlber@redhat.com \
--cc=senozhatsky@chromium.org \
--cc=smfrench@gmail.com \
--cc=stable@vger.kernel.org \
--cc=tom@talpey.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).