diff options
| author | Yuezhang Mo <Yuezhang.Mo@sony.com> | 2025-09-30 13:42:57 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-10-23 16:20:27 +0200 |
| commit | 39563a86579ae9aec0e6adddae46cfa42a1e1425 (patch) | |
| tree | e709f0352d3bb5addbdc7ff99fe41a62e728da88 /fs | |
| parent | f32fea4c0234c971c12e46d76612cdc2dd4bb046 (diff) | |
| download | linux-39563a86579ae9aec0e6adddae46cfa42a1e1425.tar.gz linux-39563a86579ae9aec0e6adddae46cfa42a1e1425.tar.bz2 linux-39563a86579ae9aec0e6adddae46cfa42a1e1425.zip | |
dax: skip read lock assertion for read-only filesystems
[ Upstream commit 154d1e7ad9e5ce4b2aaefd3862b3dba545ad978d ]
The commit 168316db3583("dax: assert that i_rwsem is held
exclusive for writes") added lock assertions to ensure proper
locking in DAX operations. However, these assertions trigger
false-positive lockdep warnings since read lock is unnecessary
on read-only filesystems(e.g., erofs).
This patch skips the read lock assertion for read-only filesystems,
eliminating the spurious warnings while maintaining the integrity
checks for writable filesystems.
Fixes: 168316db3583 ("dax: assert that i_rwsem is held exclusive for writes")
Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Friendy Su <friendy.su@sony.com>
Reviewed-by: Daniel Palmer <daniel.palmer@sony.com>
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/dax.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1578,7 +1578,7 @@ dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter, if (iov_iter_rw(iter) == WRITE) { lockdep_assert_held_write(&iomi.inode->i_rwsem); iomi.flags |= IOMAP_WRITE; - } else { + } else if (!sb_rdonly(iomi.inode->i_sb)) { lockdep_assert_held(&iomi.inode->i_rwsem); } |
