diff options
| author | Ming Lei <[email protected]> | 2025-03-18 07:29:55 +0000 |
|---|---|---|
| committer | Jens Axboe <[email protected]> | 2025-03-18 14:03:30 +0000 |
| commit | 86947bdc28894520ed5aab0cf21b99ff0b659e07 (patch) | |
| tree | cf4587e035c3127c0f3f26095f95feaea4d2bc89 /net/unix/unix_bpf.c | |
| parent | block: Make request_queue lockdep splats show up earlier (diff) | |
| download | kernel-86947bdc28894520ed5aab0cf21b99ff0b659e07.tar.gz kernel-86947bdc28894520ed5aab0cf21b99ff0b659e07.zip | |
loop: move vfs_fsync() out of loop_update_dio()
If vfs_flush() is called with queue frozen, the queue freeze lock may be
connected with FS internal lock, and lockdep warning can be triggered
because the queue freeze lock is connected with too many global or
sub-system locks.
Fix the warning by moving vfs_fsync() out of loop_update_dio():
- vfs_fsync() is only needed when switching to dio
- only loop_change_fd() and loop_configure() may switch from buffered
IO to direct IO, so call vfs_fsync() directly here. This way is safe
because either loop is in unbound, or new file isn't attached
- for the other two cases of set_status and set_block_size, direct IO
can only become off, so no need to call vfs_fsync()
Cc: Christoph Hellwig <[email protected]>
Reported-by: Kun Hu <[email protected]>
Reported-by: Jiaji Qin <[email protected]>
Closes: https://lore.kernel.org/linux-block/[email protected]/T/#u
Signed-off-by: Ming Lei <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'net/unix/unix_bpf.c')
0 files changed, 0 insertions, 0 deletions
