On Wed, Apr 23, 2025 at 06:59:41AM +0200, Christoph Hellwig wrote: > The recent move of the bdev_statx call to the low-level vfs_getattr_nosec > helper caused it being used by devtmpfs, which leads to deadlocks in > md teardown due to the block device lookup and put interfering with the > unusual lifetime rules in md. > > But as handle_remove only works on inodes created and owned by devtmpfs > itself there is no need to use vfs_getattr_nosec vs simply reading the > mode from the inode directly. Switch to that to avoid the bdev lookup > or any other unintentional side effect. > > Reported-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx> > Reported-by: Xiao Ni <xni@xxxxxxxxxx> > Fixes: 777d0961ff95 ("fs: move the bdex_statx call to vfs_getattr_nosec") > Signed-off-by: Christoph Hellwig <hch@xxxxxx> > Tested-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx> > Tested-by: Xiao Ni <xni@xxxxxxxxxx> > --- > drivers/base/devtmpfs.c | 20 ++++++++------------ > 1 file changed, 8 insertions(+), 12 deletions(-) Tested-by: Heiko Carstens <hca@xxxxxxxxxxxxx>