lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f309b34e4ffb72d725bc8757434893600d4f1101.camel@ibm.com>
Date: Wed, 17 Sep 2025 19:33:02 +0000
From: Viacheslav Dubeyko <Slava.Dubeyko@....com>
To: "max.kellermann@...os.com" <max.kellermann@...os.com>
CC: Xiubo Li <xiubli@...hat.com>,
        "linux-fsdevel@...r.kernel.org"
	<linux-fsdevel@...r.kernel.org>,
        "ceph-devel@...r.kernel.org"
	<ceph-devel@...r.kernel.org>,
        "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>,
        "netfs@...ts.linux.dev"
	<netfs@...ts.linux.dev>,
        Alex Markuze <amarkuze@...hat.com>,
        "stable@...r.kernel.org" <stable@...r.kernel.org>,
        "idryomov@...il.com"
	<idryomov@...il.com>,
        "mjguzik@...il.com" <mjguzik@...il.com>
Subject: RE: [PATCH v2] ceph: fix deadlock bugs by making iput() calls
 asynchronous

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@....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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ