[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<MEYP282MB3164B39D532251DC6C36B652BFAC2@MEYP282MB3164.AUSP282.PROD.OUTLOOK.COM>
Date: Thu, 18 Jul 2024 03:04:50 +0000
From: Ryder Wang <rydercoding@...mail.com>
To: Theodore Ts'o <tytso@....edu>, Zhihao Cheng <chengzhihao@...weicloud.com>
CC: linux-fsdevel <linux-fsdevel@...r.kernel.org>,
"linux-ext4@...r.kernel.org" <linux-ext4@...r.kernel.org>, LKML
<linux-kernel@...r.kernel.org>, Jan Kara <jack@...e.cz>, Christoph Hellwig
<hch@...radead.org>, linux-mtd <linux-mtd@...ts.infradead.org>, Richard
Weinberger <richard@....at>, "zhangyi (F)" <yi.zhang@...wei.com>, yangerkun
<yangerkun@...wei.com>, "wangzhaolong (A)" <wangzhaolong1@...wei.com>
Subject: Re: [BUG REPORT] potential deadlock in inode evicting under the inode
lru traversing context on ext4 and ubifs
> Um, I don't see how this can happen. If the ea_inode is in use,
> i_count will be greater than zero, and hence the inode will never be
> go down the rest of the path in inode_lru_inode():
>
> if (atomic_read(&inode->i_count) ||
> ...) {
> list_lru_isolate(lru, &inode->i_lru);
> spin_unlock(&inode->i_lock);
> this_cpu_dec(nr_unused);
> return LRU_REMOVED;
> }
Yes, in the function inode_lru_inode (in case of clearing cache), there has been such inode->i_state check mechanism to avoid double-removing the inode which is being removed by another process. Unluckily, no such similar inode->i_state check mechanism in the function iput_final (in case of removing file), so double-removing inode can still appear.
It looks we need to add some inode->i_state check in iput_final() , if we want to fix this race condition bug.
Powered by blists - more mailing lists