Skip to content
Unverified Commit e079d7c4 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Christian Brauner
Browse files

devtmpfs: don't use vfs_getattr_nosec to query i_mode



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: default avatarShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reported-by: default avatarXiao Ni <xni@redhat.com>
Fixes: 777d0961 ("fs: move the bdex_statx call to vfs_getattr_nosec")
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/20250423045941.1667425-1-hch@lst.de


Tested-by: default avatarShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tested-by: default avatarXiao Ni <xni@redhat.com>
Tested-by: default avatarAyush Jain <Ayush.jain3@amd.com>
Tested-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Reviewed-by: default avatarChristian Brauner <brauner@kernel.org>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 0d039eac
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment