From: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
To: "max.kellermann@ionos.com" <max.kellermann@ionos.com>
Cc: Xiubo Li <xiubli@redhat.com>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"ceph-devel@vger.kernel.org" <ceph-devel@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"netfs@lists.linux.dev" <netfs@lists.linux.dev>,
Alex Markuze <amarkuze@redhat.com>,
"stable@vger.kernel.org" <stable@vger.kernel.org>,
"idryomov@gmail.com" <idryomov@gmail.com>,
"mjguzik@gmail.com" <mjguzik@gmail.com>
Subject: RE: [PATCH v2] ceph: fix deadlock bugs by making iput() calls asynchronous
Date: Wed, 17 Sep 2025 19:33:02 +0000 [thread overview]
Message-ID: <f309b34e4ffb72d725bc8757434893600d4f1101.camel@ibm.com> (raw)
In-Reply-To: <CAKPOu+8b_xOicarviAw_39b2y5ei9boRFNxxkP19zE5LGZxm=Q@mail.gmail.com>
On Wed, 2025-09-17 at 21:25 +0200, Max Kellermann wrote:
> On Wed, Sep 17, 2025 at 9:20 PM Viacheslav Dubeyko
> <Slava.Dubeyko@ibm.com> wrote:
> > > > > + WARN_ON_ONCE(!queue_work(ceph_inode_to_fs_client(inode)->inode_wq,
> > > > > + &ceph_inode(inode)->i_work));
> > > >
> > > > This function looks like ceph_queue_inode_work() [1]. Can we use
> > > > ceph_queue_inode_work()?
> > >
> > > No, we can not, because that function adds an inode reference (instead
> > > of donating the existing reference) and there's no way we can safely
> > > get rid of it (even if we would accept paying the overhead of two
> > > extra atomic operations).
> >
> > This function can call iput() too. Should we rework it, then? Also, as a result,
> > we will have two similar functions. And it could be confusing.
>
> No. NOT calling iput() is the whole point of my patch. Did you read
> the patch description?
This function can call the iput:
void ceph_queue_inode_work(struct inode *inode, int work_bit)
{
struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode);
struct ceph_client *cl = fsc->client;
struct ceph_inode_info *ci = ceph_inode(inode);
set_bit(work_bit, &ci->i_work_mask);
ihold(inode);
if (queue_work(fsc->inode_wq, &ci->i_work)) {
doutc(cl, "%p %llx.%llx mask=%lx\n", inode,
ceph_vinop(inode), ci->i_work_mask);
} else {
doutc(cl, "%p %llx.%llx already queued, mask=%lx\n",
inode, ceph_vinop(inode), ci->i_work_mask);
iput(inode); <-- we can call iput here.
}
}
I am citing you: "NOT calling iput() is the whole point of my patch". This
function can call iput(). And this is my question: Should we rework it, then?
Thanks,
Slava.
next prev parent reply other threads:[~2025-09-17 19:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-17 13:59 [PATCH v2] ceph: fix deadlock bugs by making iput() calls asynchronous Max Kellermann
2025-09-17 14:12 ` Mateusz Guzik
2025-09-17 17:55 ` Viacheslav Dubeyko
2025-09-17 19:06 ` Max Kellermann
2025-09-17 19:20 ` Viacheslav Dubeyko
2025-09-17 19:25 ` Max Kellermann
2025-09-17 19:33 ` Viacheslav Dubeyko [this message]
2025-09-17 20:20 ` Al Viro
2025-09-17 20:25 ` Max Kellermann
2025-09-17 20:27 ` Max Kellermann
2025-09-18 4:52 ` Max Kellermann
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=f309b34e4ffb72d725bc8757434893600d4f1101.camel@ibm.com \
--to=slava.dubeyko@ibm.com \
--cc=amarkuze@redhat.com \
--cc=ceph-devel@vger.kernel.org \
--cc=idryomov@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=max.kellermann@ionos.com \
--cc=mjguzik@gmail.com \
--cc=netfs@lists.linux.dev \
--cc=stable@vger.kernel.org \
--cc=xiubli@redhat.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 NNTP newsgroup(s).